[Chartjs]-ChartJS – Customize Ticks/Labels on Y Axis

0👍

You can override the callback in the ticks setting to determine what label is displayed, for example:

ticks: {
  callback: function (value, index, values) {
    return (value % 2 === 0) ? value : "";
},

Will only display the labels for the even values and hide the rest. You can customise this function to do whatever you want, including adding symbols to the labels.

Leave a comment