dc.js generate a pieChart with top 5 values

96 views
Skip to first unread message

Steven Natera

unread,
Mar 5, 2015, 11:42:24 AM3/5/15
to dc-js-us...@googlegroups.com

I'm visualizing a drug database of 200 entries. I've created a piechart using DC.js to show the frequency of each drug. The pie chart is cluttered with drugs that appear once.

I want to adjust this pie chart so that it visualizes the top 5 most used drugs i.e. the top 5 biggest slices of the pie chart.

Is there a way to use the .group() or .reduceSum() methods so only the biggest pie chart slices are shown?

Gordon Woodhull

unread,
Mar 5, 2015, 11:50:32 AM3/5/15
to dc-js-us...@googlegroups.com
Use the functions of the Cap Mixin, which is a base of the pie chart.

--
You received this message because you are subscribed to the Google Groups "dc-js user group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dc-js-user-gro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dc-js-user-group/5a97a67d-85b3-404e-b84c-aca6efacb7a1%40googlegroups.com.

Steven Natera

unread,
Mar 5, 2015, 1:33:41 PM3/5/15
to dc-js-us...@googlegroups.com
Thanks man this works!
Reply all
Reply to author
Forward
0 new messages