m3it
Posts: 4
Joined: Fri Jan 22, 2021 1:13 pm

Multi-level date x axis

I have a highcharts chart like this:
hc_x_axis_1b.png
hc_x_axis_1b.png (19.04 KiB) Viewed 715 times
but I'd like the x axis to look like this one, with only the months on one line and the year on another, but the year showing only once per year. (Ignore that one chart is line and another column)
hc_x_axis_2.png
hc_x_axis_2.png (9.34 KiB) Viewed 717 times
Is this possible in highcharts?
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Multi-level date x axis

Hello m3it!

We appreciate you reaching out to us!

Sure, it's possible. We can use grouped categories plugin for that.

Docs:
https://blacklabel.github.io/grouped_categories/
https://github.com/blacklabel/grouped_categories

Demo:
https://jsfiddle.net/BlackLabel/53vem6w1/

Best regards!
Dominik Chudy
Highcharts Developer
m3it
Posts: 4
Joined: Fri Jan 22, 2021 1:13 pm

Re: Multi-level date x axis

Thanks for the reply Dominik. In my case the x axis is a date axis (and zoomable), not categorical. Will your plugin still work for that?
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Multi-level date x axis

Hi again!

Unfortunately not, it doesn't work with the date type axis. With this plugin, you would have to set categories by yourself.

The other way to get this chart look is to use SVG Renderer and render a label below the axis with the proper year.

Docs:

https://api.highcharts.com/class-refere ... VGRenderer

Best regards!
Dominik Chudy
Highcharts Developer
m3it
Posts: 4
Joined: Fri Jan 22, 2021 1:13 pm

Re: Multi-level date x axis

Thanks again Dominik
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Multi-level date x axis

You're welcome!

In case of any further questions, feel free to contact us again.
Dominik Chudy
Highcharts Developer

Return to “Highcharts Usage”