[Chartjs]-Change space between horizontal (grid) lines for line chart

1👍

You can pass in options. While there is no option to directly set the horizontal spacing between grid lines, you can use the below (from http://www.chartjs.org/docs/#getting-started-global-chart-configuration)

// Creates a line chart in the same way
new Chart(ctx).LineAlt(data, {
     scaleOverride: true,

     scaleSteps: 10,
     scaleStepWidth: 20,
     scaleStartValue: 0,       
});

Note that you need all 4 settings.

Adjust the scaleStepWidth to control the spacing.

Leave a comment