DoumiLo
Posts: 35
Joined: Wed Jan 20, 2021 2:09 pm

Highstock: Dropdown with specific dates range

Hi,

I am trying to add a dropdown with four specifics date ranges:

1- from 2020-01-23 to 2020-04-23
2- from 2020-04-05 to 2020-08-05
3- from 2021-01-23 to 2021-04-23
4- from 2021-04-05 to 2021-08-05

How can I attach this to the range selector and update the graph when one of the date range is selected?

Thanks for your help!
DoumiLo
Posts: 35
Joined: Wed Jan 20, 2021 2:09 pm

Re: Highstock: Dropdown with specific dates range

Hello again,

I have found this solution. I simply have to find the dates in milliseconds for the date range and then use setExtremes:

Code: Select all

this.xAxis[0].setExtremes(1582848000000, 1594425600000);
The only thing that bothers me now is that my last date range is set from july 2021 to today. So I'm using getExtremes().max to set the max value:

Code: Select all

this.xAxis[0].setExtremes(1626566400000, this.xAxis[0].getExtremes().max);
Works fine with the graph but the tooltip date format is changed:

Mercredi, Sept 15, 00:00-11:59

Where it should be:

15 septembre 2021

This is not happening with the other date ranges... How can I fix that?

Thanks!
DoumiLo
Posts: 35
Joined: Wed Jan 20, 2021 2:09 pm

Re: Highstock: Dropdown with specific dates range

Hello again,

I found that this bug is only happening locally, online it's working fine.

I did not find a way to remove my post on the forum...
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Highstock: Dropdown with specific dates range

Hi DoumiLo,
Thanks for your message.

I'm glad to hear you found a solution, if you could replicate this error I will have a chance to check it out.
Users don't have access to delete posts, only the forum moderator has that permission.

If you have more questions you can reach me any time.
Best regards.
Sebastian Hajdus
Highcharts Developer
DoumiLo
Posts: 35
Joined: Wed Jan 20, 2021 2:09 pm

Re: Highstock: Dropdown with specific dates range

Hello Sebastian,

I was wrong when I said everything is working online. The third option is showing a broken date for the tooltip. I have posted another thread on the forum:

viewtopic.php?f=12&t=47498&p=171098#p171098

thanks!
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Highstock: Dropdown with specific dates range

Hi,
So that we don't repeat ourselves, my colleague Mateusz will continue your topic.

Best regards.
Sebastian Hajdus
Highcharts Developer
DoumiLo
Posts: 35
Joined: Wed Jan 20, 2021 2:09 pm

Re: Highstock: Dropdown with specific dates range

Hello,

I found the solution. It's a bug with highcharts version 9.2.2.
I have rollback to version 9.1.2 and everything works fine...
(I have also posted this answer in the other thread)
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Highstock: Dropdown with specific dates range

Hi,
Thanks for note.

Best regards!
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Stock”