Home › Forums › Chart Support › How to hide the secondary graph but not the axis label › Reply To: How to hide the secondary graph but not the axis label
The issue is happening as minimum and maximum are being updated on hiding and unhiding the dataSeries. I would suggest you to update viewportMinimum and viewportMaximum instead. Please find the code-snippet below.
chart.options.axisY.viewportMinimum = chart.axisY.viewportMinimum;
chart.options.axisY.viewportMaximum = chart.axisY.viewportMaximum;
chart.options.axisY.interval = chart.axisY.interval;
chart.options.axisY2.viewportMinimum = chart.axisY2.viewportMinimum;
chart.options.axisY2.viewportMaximum = chart.axisY2.viewportMaximum;
chart.options.axisY2.interval = chart.axisY2.interval;
Please take a look at this updated JSFiddle for complete code.