Chartjs-Setting ticks of Chart.js in html.erb file

2👍

You are using the wrong old v2 syntax of chart.js, the scales in v3 for example have to be configured like this

scales: {
  x:{
    ticks: {}
  },
  y: {
  // Y config
  }
}

EDIT:
Since you are on V2 your syntax of declaring axis is correct, make sure you dont run the latest version of chartKick since it uses v3.

distribution does not do anything unless your scale type is time. The stepSize only works for linear and time scales so you will need to change type: 'category' to type: 'linear' or if you are using time data to type: 'time' if you are using time data the stepsize has to be configured in the time sub part so you will need to change ticks to time

Leave a comment