[Chartjs]-How can I put sign (%) on data in ChartJS?

1👍

This works on a bar chart, haven’t tried it on a pie chart. Hope it works for you.

yAxes: [
    {
        ticks: {
            callback: function (value, index, values) {
                return value + " %";
            }
        }
    }
]

1👍

This solution worked for me.

tooltips: {
      mode: 'label',
      callbacks: {
        label: function (tooltipItem, data) {
          var indice = tooltipItem.index;
          return data.labels[indice] + ': ' + data.datasets[0].data[indice] + '%';
        }
      }
    }

Leave a comment