highcharts / highcharts-vue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query: Display days and month headings in Gantt style chart

philipbelcher opened this issue · comments

Hi guys.

I've got a Gantt style chart that displays a series of days and their dates along the xAxis. I'm wondering if there's a way I can go about adding the month above those days so it looks similar to this mockup (I've added the months in red text)
Group

I'm currently overriding the day formatter using the following code, but obviously if I add the month into there, it's repeated for each day:

dateTimeLabelFormats: {
    day: '%e<br><span style="opacity: 0.5; font-size: 0.7em">%a</span>',
},

Thanks in advance!

Hi, thanks for the question!

You can achieve this with the SVGRenderer which helps you render custom SVGElements on the chart. Here's a super simple demo: https://jsfiddle.net/cmq4h910/ which should give you a brief idea of how it could work. If you're okay with this approach, I can guide you through it and give you some more tips how to implement that.

Alternatively, you could try modifying the dateTimeLabelFormat property and styling the top element of the xAxis table with CSS and SVG attributes so that it fits your designs.

This is not really related to the highcharts-vue integration, but more to the Highcharts Gantt behavior so I'm closing this issue here, but feel free to ask in case you have any questions.