Bangarayya Tadi
Bangarayya Tadi

Reputation: 13

Pie chart legend styling using Chart js

How to style legend type from rectangle box to circle? pie chart using chartjs.orgenter image description here

Upvotes: 0

Views: 4398

Answers (2)

roberto eric carimo
roberto eric carimo

Reputation: 1

put the dataset like this:

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

Upvotes: 0

ɢʀᴜɴᴛ
ɢʀᴜɴᴛ

Reputation: 32879

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
      }
   },
   ...
}

Upvotes: 2

Related Questions