bazzacad
Posts: 20
Joined: Mon Jun 26, 2017 9:00 pm

How to show start of week date instead of week number?

How can I get my Gantt chart to show the date of each Monday of the week, instead of the week numbers?
So Week 11 would be Mar 14, Week 12 would be Mar 21, etc...
2022-03-17 14_47_14-Team Schedule.png
2022-03-17 14_47_14-Team Schedule.png (16.37 KiB) Viewed 1001 times
magdalena
Posts: 517
Joined: Tue Aug 24, 2021 1:32 pm

Re: How to show start of week date instead of week number?

Hi,

Thanks for contacting us with your question!

Use xAxis.dateTimeLabelFormats property for setting the relevant axis label. Please check the API documentation for more details.

API Reference:
https://api.highcharts.com/gantt/xAxis. ... belFormats

Demo:
https://jsfiddle.net/gh/get/library/pur ... el-formats

The other approach is using labels.format or labels.formatter. More information on a similar thread in this forum and API:
Gantt chart: how to make dates in xAxis jump from months-years to days-months?

API References:
https://api.highcharts.com/gantt/xAxis.labels.format
https://api.highcharts.com/gantt/xAxis.labels.formatter

Demo:
https://jsfiddle.net/BlackLabel/2gk67zrm/

Feel free to ask any further questions,
Regards!
Magdalena Gut
Developer and Highcharts Support Engineer

Return to “Highcharts Gantt”