Cortez
Posts: 85
Joined: Fri May 29, 2020 9:41 am

Heatmap shows different colorAxis values depending on navigator enabled/disabled

Hi guys!
https://jsfiddle.net/Cortez/vr2pnqd4/

Try to toggle navigator enabled true / false and you will see that colorAxis legend values are different. With enabled: true they are 0, 10, 20, 30. But with enabled: false they are 5, 10, 15, 20, 25.

What is this behaviour?
Thanks!
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Heatmap shows different colorAxis values depending on navigator enabled/disabled

Hello,

If you go deeper into the API, in the description of the colorAxis.max property that changes, you can read:
If the endOnTick option is true, the max value might be rounded up.

Moving on in the description of the property yAxis.endOnTick, writes:
In Highcharts Stock, endOnTick is always false when the navigator is enabled, to prevent jumpy scrolling.

API: https://api.highcharts.com/highstock/colorAxis.max
https://api.highcharts.com/highstock/yAxis.endOnTick

Let me know if you have any further questions!
Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
Cortez
Posts: 85
Joined: Fri May 29, 2020 9:41 am

Re: Heatmap shows different colorAxis values depending on navigator enabled/disabled

michal,
thanks for your reply. This makes things clearer. However, I do not get what I need to do to avoid that behavior? I mean I need colorAxis legend stay the same regardless if navigator is enabled or disabled. I tried settings yAxis.endOnTick to 'false', but that did not help.
Any advice?
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Heatmap shows different colorAxis values depending on navigator enabled/disabled

Hi,

If you want to hard-set value, you can do it using the property colorAxis.max.
Demo: https://jsfiddle.net/BlackLabel/9yrj4okv/

Best regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
Cortez
Posts: 85
Joined: Fri May 29, 2020 9:41 am

Re: Heatmap shows different colorAxis values depending on navigator enabled/disabled

michal,
thanks for that advice. And If I wouldn't like to hard-set max value - is there another way for colorAxis remain same regardless of navigator on/off?
Thanks!
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Heatmap shows different colorAxis values depending on navigator enabled/disabled

Hello,

Another option than setting the maximum value is to set colorAxis.tickInterval to 5 or 10.

Demo: https://jsfiddle.net/BlackLabel/3uayx0c8/
API: https://api.highcharts.com/highstock/co ... ckInterval

Regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/
Cortez
Posts: 85
Joined: Fri May 29, 2020 9:41 am

Re: Heatmap shows different colorAxis values depending on navigator enabled/disabled

michal
That is exactly what I need! Many thanks for being super helpful!
michal.f
Posts: 1114
Joined: Thu Aug 12, 2021 12:04 pm

Re: Heatmap shows different colorAxis values depending on navigator enabled/disabled

That's great to hear!

Regards!
Michał Filipiec
Highcharts Developer
https://blacklabel.pl/highcharts/

Return to “Highcharts Stock”