Chart JS : Display the percentage of labels without getContext('2d')

๐Ÿ‘:0

Please provide the version of chartjs that you are using.

Did you mean you want to show the % in the label of the tooltip?

For version v3.8.0, here is a working code I have just made, Link

As in option, you can edit the label of tooltip as you want:

options: {
    plugins: {
      tooltip: {
        callbacks: {
          label: (tooltipItem) => {
              //tooltipItem is for the slice of the pie you are hovering now
              return ' ' + tooltipItem.parsed + '%';
            },
        }
      }
    }
  }

Leave a comment