[Chartjs]-Chartjs! How to remove datalabel when value is 0

2👍

You can use formatter instead of callback like below.

plugins: {
  datalabels: {
    color: '#616161',
    formatter: (value) => {
      return value > 0 ? value : '';
    }
  }
}

One of the examples is as follows.

https://jsfiddle.net/opgk246j/

Leave a comment