Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Doughnut dataset data draw order

Open jezmck opened this issue 3 years ago • 1 comments

Feature Proposal

I have a doughnut chart, and am using the following options to create rounded ends to each arc.

elements: {
  arc: {
    borderRadius: 99,
    borderWidth: 10,
  },
},

This nearly works, but I need the first datum to be drawn last (i.e. on top) since my data is sorted to have the smallest first.

As it is currently: image

It'd be good to be able to specify what order the arcs are drawn in, so that the grey one is at the back and not obscuring the others.

Possible Implementation

datasets: [{
  data: [1,2,3,5,11],
  order: [5,4,3,2,1],
}]

jezmck avatar Nov 01 '22 16:11 jezmck

Is there any workaround to make drawing order of arcs possible?

bernardwiesner avatar Dec 14 '23 16:12 bernardwiesner