1
votes

I am building a line chart using ChartJS. I want to increase the spacing between the vertical tick marks on the Y-Axis. Here is a slice of the relevant options being passed to ChartJS. Is there a property in the ticks section that will allow me to increase the spacing between the ticks, thereby increasing the total height of the chart canvas?

lineChartOptions = {
    scales: {
      yAxes: [
        {
          id: 'y-axis-0',
          position: 'left',
          ticks: {
              ...    // <-- WHAT OPTION GOES HERE?
          }
        },

Note: It is not an option to simply decrease the height of the canvas using CSS, the canvas stretches to fill the space thereby distorting the chart.

1

1 Answers

0
votes

If not much different data you can use this to set range

//EXAMPLE DATA [533,743,612,983]
ticks: {
    beginAtZero: false,
    stepSize: 100,
    max: 1000
    min: 500
}