nunoarruda
Posts: 3
Joined: Tue Mar 09, 2021 2:52 pm

allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hi,

Please consider the following demo: https://codepen.io/nunoarruda/pen/YzpRqXG

Image

Notice that:

1. I'm using the allButtonsEnabled property to enable the range selector buttons even if there is an incomplete time-range (not enough data points for a time-range)

2. With a complete time-range (enough data points for a 1-month time-range, for example), the 1-month button works and gets its selected UI state (lilac color) when clicked.

3. With an incomplete time-range (not enough data points for an entire 1-month, for example), the 1-month button still works and but it loses its selected UI state (lilac color) when clicked. I was expecting the 1-month button to still get its selected UI state (lilac color) when clicked.

Is this expected? Or perhaps, is this a bug?

Thanks in advance!
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hello nunoarruda!

We appreciate you reaching out to us!

You need to know that if you define your own custom buttons, then allButtonsEnabled property doesn't work. The state of the buttons depends on the data (amount of points) they've zoomed in to. You can set your own extremes in the click function to zoom in to e.g 2 or 3 months.

If you have any specific questions feel free to ask them. :-)

API references:
https://api.highcharts.com/highstock/ra ... or.buttons
https://api.highcharts.com/highstock/ra ... ents.click
https://api.highcharts.com/class-refere ... etExtremes

Best regards!
Dominik Chudy
Highcharts Developer
nunoarruda
Posts: 3
Joined: Tue Mar 09, 2021 2:52 pm

Re: allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hi Dominik, thanks for pointing me in the right direction.
dominik.c wrote: Fri Mar 12, 2021 11:34 am You need to know that if you define your own custom buttons, then allButtonsEnabled property doesn't work.
Just a side note, are you sure about the allButtonsEnabled property not working with custom buttons? In my demo, if you toggle the allButtonsEnabled property you will notice that it does enables/disables the 1m custom button. Highcharts own datagrouping demo also shows that.

Thanks again!
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hi again!

I'm so sorry, you're right about that. allButtonsEnabled property works also when you have custom buttons and it makes them all enabled.

Best regards!
Dominik Chudy
Highcharts Developer
DoriBro
Posts: 18
Joined: Tue Mar 23, 2021 8:42 pm

Re: allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hi nunoarruda,

I am experiencing the same exact behavior as you. I have data that doesn't fill a given time range, but I have allButtonsEnabled set to true. All of the buttons function properly, but certain buttons don't get the "selected" or "pressed" UI that I want. Example: If I only have 14 days worth of data but press the "1m" button, it functions properly but the "1m" button doesn't get the "selected" or "pressed" color. Did you ever figure out a way to make this happen?

Thank you!
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hi DoriBro!

I've noticed that you've already asked a similar question over here: viewtopic.php?f=12&t=46175&p=165256#p165256

Check this topic to get your answer and for the future please do not duplicate topics.

Best regards!
Dominik Chudy
Highcharts Developer
DoriBro
Posts: 18
Joined: Tue Mar 23, 2021 8:42 pm

Re: allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hi dominik.c,

I just checked it. Thank you for the help!

I won't duplicate topics in the future. Sorry about that.

Best regards,
Dorian
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: allButtonsEnabled + incomplete time range makes range button lose selected UI state (lilac color)

Hi again!

No problem and thanks for that! :)

Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Stock”