简体   繁体   中英

how resetZoom() en multiple charts (ng2charts or chartjs)?

i have a page with multiple charts and i add the pluggin for zoom.

i reset the zoom making

this.chart.chart['resetZoom']();

and it work... in only 1 chart, just the first one.

if i make xonsole.log to this.chart, the element get only the firts chart. also, if i made this.chart.update() it work with all the charts

@ViewChild(BaseChartDirective, {static: true }) chart: BaseChartDirective;

that its the way that i access to the chart functions

i can't post the code becaouse its tooooooooo long xD

You can try to assign created chart to a property in your class, and after that to call.reset(). Check this example: Stackblitz

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM