Interact with Chart Widget
How can I interact with a chart widget using javascript? So I can call something like chart.resetZoom()?
4 Replies
is
resetZoom
an option, dont remember.
you can pass it I think on the $options
like this:
https://filamentglow.com/trick/hide-grids-in-chart-widgets-18382e72I installed this plugin: https://www.chartjs.org/chartjs-plugin-zoom/latest/guide/
And I want to have a button that calls chart.resetZoom
But it seems like, it's not that easy to access the charts in filament via JS, right?
Getting Started | chartjs-plugin-zoom
A zoom and pan plugin for Chart.js >= 3.0.0
no sure 100%
but these are options
you can pass them as a php array and I think the plugin will add the button, test and see π
no, the plugin will not add the button. In ChartJS it's pretty common to do things like chart.someMethod() and call it via JS. That's why I'm asking how I can access this.