Pie Chart Slices order

135 views
Skip to first unread message

Elias Khalil

unread,
Feb 11, 2015, 8:21:29 AM2/11/15
to c3...@googlegroups.com
I Notice that the Pie chart draws the slices in order starting from the bigger to the lower even if the data given is not sorted

Is there a way to arrange the slices order in the pie in a fixed order not dependent on the size??

Kevin Audleman

unread,
Feb 11, 2015, 1:33:26 PM2/11/15
to Elias Khalil, c3...@googlegroups.com
Elias,

The data param takes an optional 'order' param that sets sorting. 

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30],
            ['data2', 120],
        ],
        order: null,  // <------------------------------------ this eliminates any sorting and just displays data as entered
        type : 'pie',

On Wed, Feb 11, 2015 at 5:21 AM, Elias Khalil <elia...@gmail.com> wrote:
I Notice that the Pie chart draws the slices in order starting from the bigger to the lower even if the data given is not sorted

Is there a way to arrange the slices order in the pie in a fixed order not dependent on the size??

--
You received this message because you are subscribed to the Google Groups "c3js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c3js+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/c3js/a48eeb00-cb06-4c1a-8bde-1ee87f66ff33%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Kevin Audleman
Senior Developer
Reply all
Reply to author
Forward
0 new messages