angular 中引用了Echarts

 在angular 中引用了Echarts导致Cannot read property getAttribute of null

我需要通过监听值的变化,然后去改变echarts的数据

因为我用的是id:<div id="repairPieRightChart"></div> 进来就会报错Cannot read property getAttribute of null

怎么解决??????

你渲染echarts的时候页面元素还没有准备好

应该把渲染echarts的方法放在 ngAfterViewInit 里边进行调用