sectioni
Posts: 47
Joined: Thu Dec 31, 2015 2:17 pm

Y axis values are cut

Hello

My company has run out of real stuff to let me do and they are now venturing into the realm of insignificance.

How can I make it so that the value on top of the Y axis won't be cut?
Yaxis.png
Yaxis.png (25.55 KiB) Viewed 193 times
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Y axis values are cut

Hello sectioni!

We appreciate you reaching out to us!

You can change the max property on yAxis to make sure that the last tick will be visible. You also need to remember to set endOnTick property to false so the max value won't be rounded up.

API references:
https://api.highcharts.com/highcharts/yAxis.max
https://api.highcharts.com/highcharts/yAxis.endOnTick

We can also calculate dynamically the biggest value and adjust the tick on the axis to this value. E.g the last tick on axis is two times bigger than the max value.

API references:
https://api.highcharts.com/highcharts/chart.events.load
https://api.highcharts.com/class-refere ... xis#update

Demo:
https://jsfiddle.net/BlackLabel/8zLrceu5/

Let me know if that was what you were looking for!
Best regards!
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”