dansherwin
Posts: 4
Joined: Thu Jun 30, 2022 12:25 am

2 xaxis, 2 series, 1 set of labels for both

I have a chart that is oh so close to doing what I want it to do. Here is the fiddle for it: https://jsfiddle.net/dracos85/6hcrw9xz/9/

Now this chart looks precisely like I want it to. I have 2 series of data. Each series is a set of data for a day with a data point for each minute of the day. Series 1 is one day, series 2 is another day. I created to xAxis so that I could overlay the two series and have the xAxis labels be just the times. I have hidden the second xAxis not visible so there would only be one set of ticks and labels at the bottom.

The problem is, I want to be able to click on the series legend at the bottom and be able to hide and show each series, but when I hide Series 1, of course the ticks and labels go away as well.

How do I get a single set of ticks and labels, be able top hide and show the series, and not have the ticks and labels go away?
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: 2 xaxis, 2 series, 1 set of labels for both

Hello,

Thank you for contacting us!

The solution to your issue is quite simple. Set the chart.ignoreHiddenSeries to false, so that the xAxis ticks and labels won't hide (event after disabling the series).
API Reference: https://api.highcharts.com/highcharts/c ... ddenSeries
DEMO: https://jsfiddle.net/BlackLabel/bguwd70a/

Let me know if that's what you were looking for,
Best regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”