Chartjs-Show label on only top bar in stacked bar chart with Chart.js

1๐Ÿ‘

โœ…

I ended up figuring out the answer to this myself. I changed the formatter function to this:

formatter: function(value, context) {
   return context.datasetIndex == 1 ? context.chart.data.labels[context.dataIndex] : ' ';
}

Leave a comment