Chartjs-Chart.js bar chart with time on X axis and category on Y axis is not rendered

2👍

You could define your yAxis values as numbers. In my code “Yes” = 2 and “No” = 1.

data: [2, 1, 2, 1]

Then use yAxist.ticks.callback to return meaningful tick labels

yAxes: [{
  ticks: {
    beginAtZero: true,
    stepSize: 1,
    callback: value => {
      if (value == 0) {
        return '';
      }
      return value == 1 ? 'No' : 'Yes';
    }
  }
}]

Please have a look at the following StackBlitz

Leave a comment