我有一個圖表,我想包括在我的網站使用Chart.js。在Y軸它給我的實數不是整數,這就是我想要的,這裏是什麼,我現在有一個畫面:如何將實數的Y軸值更改爲chartjs中的整數?
這就是代碼:
var lineChartData = {
labels : ["2013/04/01","2013/03/31", "2013/03/30", "2013/03/29", "2013/03/28","2013/03/27", "2013/03/26"],
datasets : [
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
pointColor : "rgba(151,187,205,1)",
pointStrokeColor : "#fff",
data : ["0", "2","1", "0", "1","0","1"]
}
]
}
var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Bar(lineChartData);
需要這個,你解決了嗎? – Mewel