Pie chart





This is the pie chart section of the gallery. The pie chart is highly criticized in dataviz for meaningful reasons. You should read more about that before making one.If you're sure about what you're doing, learn how to build one with d3.js using the examples below.

Note

It is of interest to note that pie chart and donut chart are built using exactly the same process in d3.js. Thus, you probably want to visit the donut section for more examples

Donut chart section



Step by step

Building a pie chart in d3.js always start by using the d3.pie() function. This function transform the value of each group to a radius that will be displayed on the chart. This radius is then provided to the d3.arc() function that draws on arc per group.





Selection of blocks

A selection of examples showing the application of the basic concept to real life dataset.

Related chart types


Treemap
Doughnut
Pie chart
Dendrogram
Circular packing
Sunburst