我在用Chart.js繪製一個條形圖。只是不能讓任何東西顯示在屏幕上,沒有顯示錯誤信息。我究竟做錯了什麼?用Chart.js繪製條形圖
CDN https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.1.3/Chart.min.js
<script>
var income = document.getElementById("income").getContext("2d");
new Chart(income).Bar(barData);
var barData = {
labels : ["January","February","March","April","May","June"],
datasets : [
{
fillColor : "#48A497",
strokeColor : "#48A4D1",
data : [456,479,324,569,702,600]
},
{
fillColor : "rgba(73,188,170,0.4)",
strokeColor : "rgba(72,174,209,0.4)",
data : [364,504,605,400,345,320]
}
]
}
</script>
<canvas id="income" width="600" height="400"></canvas>