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

#22413

@satyabratacanvas,

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[0].viewportMinimum;
chart.options.axisY.viewportMaximum = chart.axisY[0].viewportMaximum;
chart.options.axisY.interval = chart.axisY[0].interval;

chart.options.axisY2.viewportMinimum = chart.axisY2[0].viewportMinimum;
chart.options.axisY2.viewportMaximum = chart.axisY2[0].viewportMaximum;
chart.options.axisY2.interval = chart.axisY2[0].interval;

Please take a look at this updated JSFiddle for complete code.


Vishwas R
Team CanvasJS