I am using line chart from http://www.chartjs.org/
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?
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
});
}
Note this answer is relevant to the 1.x versions of chart.js The
scales
object in the 2.x versions is quite different. See @OferSegev answer below and the 2.x documentation here.Is there documentation for v1.x as well @Boaz
@IshanMahajan There used to be :) I can't seem to find it anymore. I think this is a good mirror: web-beta.archive.org/web/20150816192112/http://…