trankieu2002
Posts: 4
Joined: Mon Dec 06, 2021 4:51 pm

Interval of datetime is not make sense

The highcharts in Reactjs with 2 lines have different endpoint of time, but they end at the same.
The problem: https://pasteboard.co/LVvwTovIAB8T.png
- The blue line end on Tuesday, Jun 23th 2020
- The dot line end on Friday, Sep 1st 2023

My expectation: https://pasteboard.co/x1O67mS8wCGq.png

This will make the user confused at the first look at the chart.
My demo: https://jsfiddle.net/af9uxrw0/3/
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Interval of datetime is not make sense

Hello trankieu2002,

Welcome to our forum and thanks for contacting us with your question!

The chart behaves like this because of ordinal option, which is enabled by default for stock charts. Why it is enabled by default and what it exactly does you can read here: https://api.highcharts.com/highstock/xAxis.ordinal
You can disable it simply by setting its value to false.
Demo: https://jsfiddle.net/BlackLabel/6b4n57od/

Let me know if that was what you were looking for!
Regards!
Mateusz Bernacik
Highcharts Developer
trankieu2002
Posts: 4
Joined: Mon Dec 06, 2021 4:51 pm

Re: Interval of datetime is not make sense

Very nice!!

I can resolve my stuff now.
Thanks for your support @mateusz.b
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Interval of datetime is not make sense

You're welcome! In case of any further questions, feel free to contact us again.
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”