Reputation: 1774
I have a basic two axis line chart, with one series. Its data are datetime on xAxis, and average numbers for yAxis. When I load the page with my chart, I have a nice xAxis display with a label for every other month, which allows the chart to be nicely presented, and readable.
Whenever I click the legend button to hide this series, (I still show the xAxis even if the chart is now empty), and then click it again to show it, the xAxis now displays every month (twice as many as before) and the label texts are overlapping each other.
If I try to hide and display the series again, I have the same result. Could it be that once the hide function is fired by the legend button, it is deleting some of my options, or is changing them automatically?
Basically, all I want is to keep the "every other month" label display for my xAxis, no matter how many times I hide or toggle my series.
EDIT : I tried to set chart.ignoreHiddenSeries
to false and the xAxis is not changing anymore, but I kinda wanted to keep the scalable feature for the yAxis... And now when I toggle or hide another series, the yAxis stands still.
Any workaround? This is just a half solution for me.
Upvotes: 1
Views: 1036
Reputation: 37588
You can try to use showEmpty() function http://api.highcharts.com/highcharts#xAxis.showEmpty
Upvotes: 1