888ba8
Posts: 44
Joined: Mon Dec 21, 2020 11:18 am

Rotation on dataLabels (x Axis) does not allow for align:left or :right

When including

Code: Select all

dataLabels: [{
        format: '{point.start:%b %d}',
                align: 'left',reserveSpace: true,rotation: 45,
      },
the left-alignment does not seem to be applied? How can we find a way to still have the items on the left-most part of the datalabel?

Also, I would be interested to know in any best practices to have both begin and end date indicated on a dataLabel on your Gantt charts ... since it is difficult to print them... Highcharts seems to automatically cut them off. If I resize them small enough, they are outputted correctly, but then sometimes no longer when exporting using the export module.
Fusher
Posts: 7912
Joined: Mon Jan 30, 2012 10:16 am

Re: Rotation on dataLabels (x Axis) does not allow for align:left or :right

Hi!

Thank you for using Highcharts Gantt!

Regarding the issue with align+rotation, I see you reported this issue on our GitHub: https://github.com/highcharts/highcharts/issues/3070. You are right, it looks broken, I created a separate ticket for this issue: https://github.com/highcharts/highcharts/issues/14862

Regarding missing dataLabels in certain situations, this is most likely caused by `dataLabels.allowOverlap` option. By default, if two dataLabels overlap, we hide one of them. See: https://jsfiddle.net/BlackLabel/bwvd8z2L/1/ - in the Marketing category, the second task has only one dataLabel visible. If you increase the length of the task, dataLabel will show up. You can either disable this feature by setting `allowOverlap: true`: https://jsfiddle.net/BlackLabel/bwvd8z2L/2/ or increase the size of the exported chart, see our docs: https://www.highcharts.com/docs/export- ... rted-image
Paweł Fus
Highcharts Developer

Return to “Highcharts Gantt”