leonaedelinski
Posts: 7
Joined: Tue Jan 31, 2023 8:18 pm

Customize xAxis labels in Gantt chart

Hello,

Is it possible to customise (set) xAxis labels to be same interval and width, for example, the label string to be incremented by 2.5 min each. Here is design example for it. How is it possible to achieve this?
Screenshot 2023-01-31 at 21.28.22.png
Screenshot 2023-01-31 at 21.28.22.png (23.85 KiB) Viewed 777 times
michal.f
Posts: 1103
Joined: Thu Aug 12, 2021 12:04 pm

Re: Customize xAxis labels in Gantt chart

Hi, welcome to our forum!

You need to set xAxis.units property in combination with xAxis.tickInterval to set such an interval. And to set this formatting for labels you need to use xAxis.labels.formatter() callback function.

Demo: https://jsfiddle.net/BlackLabel/jh6bm7yz/
API: https://api.highcharts.com/highcharts/xAxis.units
https://api.highcharts.com/highcharts/x ... ckInterval
https://api.highcharts.com/highcharts/x ... .formatter

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

Return to “Highcharts Gantt”