How to set max and min value for Y axis

后端 未结 17 2085
既然无缘
既然无缘 2020-11-27 11:08

I am using line chart from http://www.chartjs.org/ \"enter

As you can see max value (1

17条回答
  •  感情败类
    2020-11-27 11:42

    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 
        });
    }
    

提交回复
热议问题