1👍
Yes, you can change this by setting “enabled” to false and/or use chart.resetZoom() link
0👍
Try this:
// since myChart.update() is not working. You need to do this.
var myChartOptions = myChart.options; // need to store in variable.
// check data present
if (data.length > 0) {
myChartOptions.pan.enabled = true;
myChartOptions.zoom.enabled = true;
myChart.options = myChartOptions; // update myChart.options.
}
else {
myChartOptions.pan.enabled = false;
myChartOptions.zoom.enabled = false;
myChart.options = myChartOptions; // update myChart.options.
}
- [Chartjs]-How can I round close values to one decimal place on y Axis in chart.js
- [Chartjs]-Chart.js – data points get smaller after hover
Source:stackexchange.com