Javascript Chart.js Scale Correction

I have a simeple question about Chart.js, I would like to know how I can fix my chart.

I am using Chart.js and respChartJS ( https://github.com/arifLogic/respChartJS )

Demo: http://jsfiddle.net/k3YH7/1/

var data = { labels : ["Something #1","Something #2","Something #3"], datasets : [ { fillColor : "rgba(224, 34, 34, 0.5)", strokeColor : "#830505", data : [1500,1500,1500] } ] } respChart($("#chart2"),data); 

Well, these bars are so small and do not work as I expected. How can I make it visible? I want the box to scale better, for example: 500, 1000, 1500, 2500, etc.

+6
source share
2 answers

To draw my chart. Line with a fixed scale of the Y axis, I use this code:

 mychart.Line(data,{scaleOverride: true, scaleStartValue: 0, scaleStepWidth: 1, scaleSteps: 30}); 

This should also work for the chart.Bar object.

+15
source

Check out these answers:

chartjs: how to adjust custom scale on a histogram

how to change y axis values ​​from real numbers to integer in chartjs?

Basically you should add this to your data sets (where n is the number of scale steps you want):

  scaleOverride:true, scaleSteps:n, scaleStartValue:0, scaleStepWidth:500, 
0
source

All Articles