Hi,
I’m trying to zoom out if data input is changed so that the user doesn’t have to press reset/get confused of no values displayed.
I tried with this function that I saw which almost has what i want. (source: https://canvasjs.com/docs/charts/how-to/sync-across-multiple-charts/)
chart.options.axisX.viewportMinimum = chart.options.axisX.viewportMaximum = null;
chart.options.axisY.viewportMinimum = chart.options.axisY.viewportMaximum = null;
The thing is I want to keep my settings after reset and I can’t get it to work. What attribute should I set? I tried with several values on viewport before and it doesn’t look good. I just want a zoom out without changing the values if possible.
const xAxis = {
title:labels[0],
suffix: prefix[0].concat(units[0]),
maximum: xdiff,
viewportMinimum: 0,
}
const yAxis = {
title:labels[1],
suffix: prefix[1].concat(units[1]),
maximum: ydiff,
}