You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Angular 16中Zingchart无法渲染问题求助

Angular 16集成Zingchart图表页面空白求助

我在Angular 16项目中尝试展示Zingchart图表,但页面始终空白。已完成以下操作:

  • 执行安装命令:npm i zingchart --save
  • 执行安装命令:npm i zingchart-angular --legacy-peer-deps

当前app.component.html代码如下:

<!DOCTYPE html>
<html>
<head>
  <script src="https://cdn.zingchart.com/zingchart.min.js" type="text/javascript"></script>

</head>
<body>

  <div id="myChart"></div>

  <script>
    let chartData = {
      type: 'pareto',
      series: [
        {
          values: [
            4642,
            4345,
            2350,
            1251
          ]
        }
      ]
    };

    // Render Method[3]
    zingchart.render({ 
      id: 'myChart',
      data: chartData,
      height: 400,
      width: '100%'
    });
  </script>
</body>
</html>

项目依赖版本:

  • @angular/core: ^16.1.0
  • zingchart: ^2.9.11-1
  • zingchart-angular: ^1.0.17

已在Edge和Chromium浏览器中测试,问题仍未解决,恳请提供帮助。

内容的提问来源于stack exchange,提问作者SaschaG

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 00:37:05