CanvasJS错误:找不到ID为“ chartContainer1”的图表容器

时间:2018-08-05 11:12:56

标签: angular angular-material canvasjs

enter image description here我想在角材料模式中加载canvasjs图表。但是当我渲染图表时,出现此错误 CanvasJS错误:未找到ID为“ chartContainer1”的图表容器 我在下面的错误中添加了3张代码图片... enter image description here

enter image description here

1 个答案:

答案 0 :(得分:0)

Try putting a delay in calling initChart('line'),
i.e 
setTimeout(() => {
    initChart('line');
}, 1000)