Chartjs-Pie chart legend styling using Chart js

2👍

You could accomplish so, by setting usePointStyle property to true for legend labels in your chart options, like this …

options: {
   legend: {
      labels: {
         usePointStyle: true  //<-- set this
      }
   },
   ...
}

0👍

put the dataset like this:

datasets: [{
    data: [10, 20, 30],
    backgroundColor: [
       'red',
       'orange',
       'blue'
    ],
}]

Leave a comment