Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prevent d3 donut chart from sorting automatically

Is there a way to prevent a donut chart from sorting values automatically? I don't see anywhere where I have specified that values should be sorted, yet, they are arranged in a descending order in clockwise fashion. Any suggestions would be great.

http://jsbin.com/cufuhukuki/edit?js,output

like image 786
konrad Avatar asked Oct 28 '25 18:10

konrad


1 Answers

Use sort(null) in your pie layout:

donut = d3.layout.pie().sort(null);

Here is your JS Bin: http://jsbin.com/xoqapibuvo/1/edit

like image 50
Gerardo Furtado Avatar answered Oct 30 '25 14:10

Gerardo Furtado