我想将 Apexcharts 库用于我的仪表板。现在我已经被他们文档中的一个非常简单的例子困住了(根据文档)。
我使用了他们的示例并尝试通过 ID 将其链接到我的画布容器,但是当我加载站点时它根本不显示。
我在 index.html 的最底部包含了 cdn 链接,并且我的控制台中没有任何错误。
根据开发人员工具,至少发生了一些事情:
这是我的JS:
var options = {
chart: {
type: 'line'
},
series: [{
name: 'sales',
data: [30, 40, 35, 50, 49, 60, 70, 91, 125]
}],
xaxis: {
categories: [1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]
}
};
var chart = new ApexCharts(document.querySelector("#myChart"), options);
chart.render();
这是画布容器:
<div class="column">
<div class="wrapperDoughnut">
<canvas width="220px" height="280px" id="myChart"></canvas>
</div>
</div>
慕的地8271018
相关分类