user94
Posts: 9
Joined: Wed Mar 22, 2023 7:51 pm

Multi line Categories

Is it possible to create a multi line category? Something like :

"First Line of Category in bold"
"Second line in smaller font"
jedrzej.r
Posts: 725
Joined: Tue Jan 24, 2023 11:21 am

Re: Multi line Categories

Hello,

Welcome to our forum and thanks for contacting us with your question!

Of course it's possible to render multi-line categories. In order to do so, you should define it in yAxis.categories array with HTML markup and link your data to desired category by setting y value of a task. By default, HTML markup is parsed and rendered as SVG text, but if you want to achieve more advanced output, you can enable it in yAxis.labels.useHTML property.

Demo: https://jsfiddle.net/BlackLabel/10d7jb83/

References:
https://www.highcharts.com/docs/chart-c ... formatting
https://api.highcharts.com/gantt/yAxis.categories
https://api.highcharts.com/gantt/series.gantt.data.y
https://api.highcharts.com/gantt/yAxis.labels.useHTML

Let me know if that was what you were looking for.
Best regards!
Jędrzej Ruta
Highcharts Developer

Return to “Highcharts Gantt”