lightweight-charts icon indicating copy to clipboard operation
lightweight-charts copied to clipboard

Seconds Hours Minutes

Open Gloomy1233 opened this issue 4 months ago • 3 comments

Is there anyway to show Hours minutes o seconds cause i only see you can use Days, months , Years

Gloomy1233 avatar Feb 06 '24 13:02 Gloomy1233

You can use timestamp. see this page

LIMTANX avatar Feb 13 '24 15:02 LIMTANX

If you're referring to the timescale axis, then you need to configure it via timeVisible. Example:

const chart = LightweightCharts.createChart(
  document.getElementById('container'),
  {
    timeScale: {
      timeVisible: true,
    },
  },
);

Before: Screenshot 2024-02-13 at 20 02 09

After: Screenshot 2024-02-13 at 20 01 59

tpunt avatar Feb 13 '24 20:02 tpunt

Is there a way to convert the time from a 24 hr format such as 20:30:00 to a 12hr format 8:30:00 (with maybe PM added to it ... 8:30PM)?

limbfao avatar Feb 18 '24 02:02 limbfao

You can use a formatter function for the time:

  • https://tradingview.github.io/lightweight-charts/docs/api/interfaces/LocalizationOptions#timeformatter

SlicedSilver avatar May 08 '24 10:05 SlicedSilver