angularh中使用echarts

module.ts中先引入
import { NgxEchartsModule } from ‘ngx-echarts’
业务html页面
<div echarts [options]=“chartsOption” (chartInit)=“onChartsInit($event)” [loading]=“true”></div>
业务ts页面
import { chartsOptions } from ‘echarts’

configOption:chartsOptions
chartsOption :chartsOptions =[…]

onChartsInit(event){
    this.configOption = event;
}
ngOnInit(){
    this.updateCharts();
}
updateCharts(){
    this.chartsOption= […更新内容…]
    this.configOption.setOption(this.chartsOption,true)
}

猜你喜欢

转载自www.cnblogs.com/lskzj/p/11752689.html