i can't access to te resetZoom() of the plugin charjs-zoom-plugin, any idea how can i resetZoom to the normal?
Hi @biocrista96
First you have to obtain a reference to the original chart object, then you can call resetZoom on it.
To do this:
In your template
<canvas
baseChart
#myChart="base-chart"
...
In your component:
@ViewChild("myChart")
myChart: BaseChartDirective;
onButtonClick() {
this.myChart.chart.resetZoom();
}
Here is a working example: https://stackblitz.com/edit/angular-ivy-q8jcls?file=src%2Fapp%2Fapp.component.ts
Most helpful comment
Hi @biocrista96
First you have to obtain a reference to the original
chartobject, then you can callresetZoomon it.To do this:
In your template
In your component:
Here is a working example: https://stackblitz.com/edit/angular-ivy-q8jcls?file=src%2Fapp%2Fapp.component.ts