我正在使用 http://www.chartjs.org/ 的折线图
I am using line chart from http://www.chartjs.org/
正如您所见,Y 轴的最大值 (130) 和最小值 (60) 是自动选择的,我希望最大值 = 500 和最小值 = 0.这可能吗?
As you can see max value (130) and min value (60) for Y axis are chosen automatically , I want max value = 500 and min value=0. Is this possible?
你必须覆盖比例,试试这个:(适用于 ChartJS v1.x)
You have to overrride the scale, try this: (applies to ChartJS v1.x)
window.onload = function(){
var ctx = document.getElementById("canvas").getContext("2d");
window.myLine = new Chart(ctx).Line(lineChartData, {
scaleOverride : true,
scaleSteps : 10,
scaleStepWidth : 50,
scaleStartValue : 0
});
}