amol333
Posts: 2
Joined: Thu Apr 27, 2023 5:27 pm

How to show max value on y axis in sotckchart.

stock chart max value.PNG
stock chart max value.PNG (40.43 KiB) Viewed 373 times
I want to place the threshold value to this highlighted place.
jakub.s
Posts: 1233
Joined: Fri Dec 16, 2022 11:45 am

Re: How to show max value on y axis in sotckchart.

Hi,

Welcome to our forum & thanks for the question!

In Highcharts Core you can use:
- yAxis.max to set the maximum value for the y axis
- yAxis.endOnTick to make sure that the last tick is shown

In Highcharts Stock these properties work the same but the last tick value cannot be shown as it would cover the range-selection.

There are a few workarounds around this:
1. You could use chart.renderer.text to render a custom SVG label in this place with a smaller font
2. You could increase the yAxis.max by 10 and then you would see the value 30 (but the last value would still be hidden).

Here's an example demo: https://jsfiddle.net/BlackLabel/8jem9fy1/

Let me know if that helps!

Best regards,
Jakub
Jakub
Highcharts Developer

Return to “Highcharts Stock”