[Chartjs]-Chart.js reset zoom button

3👍

You are trying to acces the canvas element, this doesnt contain the chart instance. You will need to call resetZoom on the chart instance so where you make your chart by calling new Chart you will need to store it in a variable that you can reference to call the reset on.

So you will get something like this:

const chart = new Chart(ctx, config);

chart.resetZoom();

Leave a comment