Please specify the container for the chart

使用g2的chart时报Please specify the container for the chart;

原因是组件在nz-tab中,进入页面时第二个tab就已经加载,所以创建实例时获取不到dom。

解决方案,加ngif判断,根据tab的index等于要展示组件的tab时使其展示

你可能感兴趣的:(Please specify the container for the chart)