chartjs-plugin-zoom icon indicating copy to clipboard operation
chartjs-plugin-zoom copied to clipboard

How to reset zoom?

Open SeanStewart37 opened this issue 10 years ago • 5 comments

I'm removing and adding datasets that have completely different X and Y axis data. After a user zooms in, the chart doesn't reset to the new perspective. Is there a way to force a reset?

SeanStewart37 avatar Jun 24 '16 15:06 SeanStewart37

@SeanStewart37 this is not currently possible. I'd be happy to merge a PR adding this functionality.

Essentially what would need to happen is that the original config min/max need to be stored (if specified) and then on reset either put those back or remove them completely

etimberg avatar Jun 24 '16 15:06 etimberg

@SeanStewart37 This should be addressed in PR #28.

@etimberg Would it be possible to push a new release to NPM?

pml984 avatar Aug 22 '16 14:08 pml984

@pml984 I will look into pushing a new release soon

etimberg avatar Aug 22 '16 16:08 etimberg

I reset zoom like this --> function resetZoom() { window.scatterChart.resetZoom()

    }

var ctx = $("#myChart");
window.scatterChart = new Chart(ctx, {});

also 1 thing i do when i build a new graph is remove the canvas and add again to the div

LipSoft avatar Oct 04 '16 10:10 LipSoft

Closing as resolved in #28

etimberg avatar Oct 04 '16 13:10 etimberg