Chartjs-How to count and display total value between intervals when using maxTicksLimit option in Chart.js

0👍

What i found is if we want to modify the tick marks or label, we can use ticks.callback method in the axis configuration

Refer: https://www.chartjs.org/docs/latest/axes/labelling.html

But since we wan’t in the mid of label, we can tweak it a bit like

callback: function (value, index, values) {
  if (index % 2 === 0) {
    return value;
  }
  return "Total Count";
}

but it reduces the maxTicksLimit by half

Leave a comment