我需要更新图表中的选项,并且需要使用新选项显示图表。
我希望图表不重新加载
这是我的ts。
@ViewChild(BaseChartDirective) chart: any;
lineChartOptions: any = {
responsive: true,
zoom:{
// Boolean to enable zooming
enabled: false,
sensitivity: 0.5,
// Enable drag-to-zoom behavior
drag: true,
// Zooming directions. Remove the appropriate direction to disable
// Eg. 'y' would only allow zooming in the y direction
mode: 'xy',
rangeMin: {
// Format of min zoom range depends on scale type
x: null,
y: null
},
rangeMax: {
// Format of max zoom range depends on scale type
x: null,
y: null
}
}
现在,当发生外部事件并且我需要更改选项和活动缩放时:
handleExternalEvent(){
this.lineChartOptions.zoom.enabled=true;
this.chart.chart.update();
}
问题是更新不起作用。如果我执行“this.chart.refresh()”,则会重新加载带有新选项的新图表,但是我不想重新加载图表。任何人都可以帮助我吗?
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)