Questions tagged [pie-chart]

A pie chart is a circular representation of data divided into sections by the drawing of radii.

A pie chart is a circular representation of data divided into sections by the drawing of radii.

  • Each section represents a percentage of some total.
  • The sum of the values of all sections is 100% of the total.
  • The sizes of the sections are directly proportional to the percentage of the total.
  • For example, if a given section represented 10% of the total value, the central angle of the section would be 36 degrees, or 10% of the total 360 degrees in the chart.

Questions regarding pie charts as used in programming should use this tag.

However, some aren't considering pie charts as the best option to visualize data. Often data which is visualized with pie-charts can be visualized with bar-charts as well.

In scientific software for statistical computing and graphics, function pie generates a pie chart.

Useful links


Related tags

3007 questions
15
votes
1 answer

Get unique values from pandas series of lists

I have a column in DataFrame containing list of categories. For example: 0 [Pizza] 1 [Mexican, Bars, Nightlife] 2 [American, New,…
rohan
  • 527
  • 1
  • 6
  • 19
15
votes
3 answers

How to fix chart Legends width-height with overflow scroll in ChartJS

I want to create pie chart for my project, so I am using ChartJS for it, but there are some issues with chartJS, If I am work with 10 to 20 data-field that time chart is looks good, But when I am apply more than 50 to 60 data-field in one chart, So…
Kaushik Makwana
  • 2,422
  • 9
  • 31
  • 50
15
votes
2 answers

Pie (donut) chart segment order in D3

I have a donut chart built using d3 with a jQuery slider that allows a user to select between different data-points. The chart animates the transition between data values and all is well. The problem: The segments always render in anti-clockwise…
Kerplunk
  • 182
  • 1
  • 1
  • 9
14
votes
1 answer

How to drill down charts with ChartJS?

I was very surprised that I found almost no information about this topic. I have a ChartJS pie chart that I want to drill down into after clicking a slice of the pie. How would you do that? Thank you
AlonBA
  • 444
  • 1
  • 4
  • 18
14
votes
1 answer

Increasing pie chart size with matplotlib, radius parameter appears to do nothing

Trying to make the pie larger. Looking at the docs, and other places, it says to set the radius. It seems no matter which value I put in the radius there's no increase. I'm posting the full code and the image it generates. import matplotlib.pyplot…
avoliva
  • 3,181
  • 5
  • 23
  • 37
14
votes
2 answers

Assign specific colours to data in Matplotlib pie chart

I'm trying to create pie charts with matplotlib in which the colour of each category is fixed. I've got a function which creates a pie chart from sets of value and category data. Here's one example: Category Value TI 65 Con …
Charon
  • 2,344
  • 6
  • 25
  • 44
14
votes
3 answers

Google Pie Chart show both Percentage and Values

How to display both Percentage and Values in Google Pie Chart ?
Lemo
  • 519
  • 1
  • 7
  • 22
14
votes
3 answers

How can I generate more colors on pie chart matplotlib

I am having more then 40 items to show in my chart. I have only 10 colours that repeatedly are shown on the chart. How can I generate more colors. plt.pie(f,labels=labels,autopct='%1.1f%%', startangle=90,shadow=True) I should add "color=colors"…
user3001937
  • 2,005
  • 4
  • 19
  • 23
13
votes
2 answers

Matplotlib pie chart wedge transparency?

I saw that matplotlib's pyplot.scatter() has an 'alpha' parameter that can be used to set the transparency of points. The pyplot.pie() doesn't have a similar parameter however. How can I set the transparency of certain wedges?
fariadantes
  • 347
  • 3
  • 17
13
votes
3 answers

How can I put the labels outside of piechart?

How can I put the label outside the pie chart So that labels will be in the proper place? Product <- c("Product1","Product2","Product3","Product4","Product5","Product6","Product7") Value <- c(1000000,200002,599996,1399994,2199992,2999990,3799988) df…
Let's Yo
  • 335
  • 1
  • 3
  • 11
13
votes
2 answers

Explode multiple slices of pie together in matplotlib

I really like the "explode" option on matplotlib pie charts. I was hoping to be able to "explode in groups". I'm plotting lots of little slices that fall into 3 or 4 categories. I'd like to explode all the little slices together, as groups. I figure…
Alex S
  • 4,726
  • 7
  • 39
  • 67
13
votes
2 answers

D3.js: Pie graph, adding a border only to the outter region

I got a pie graph in D3 with a stroke to separete every slice. However, I'd like to add a border only to the outter region of the slices, not in a continuos line but rather respecting the gaps created by the strokes in the original slices. See my…
odiseo
  • 6,754
  • 2
  • 20
  • 21
13
votes
3 answers

D3 - Pie Chart & Force Directed Labels

I'm looking to create a pie chart with floating labels using D3. I'm new to D3 and I'm not even sure this is possible? Can you use the labels of one graph in another somehow? If you can, can you point me to an example? Shorter Explanation: I want…
gbam
  • 1,454
  • 4
  • 18
  • 30
13
votes
2 answers

ggplot use small pie charts as points with geom_point

I would like to make a graph with ggplot as shown below. The idea is to plot "percentage matches" between two categorical variables. It is easy to come close by altering the size of points, but I wondered if it is possible to make these small pie…
midtiby
  • 14,550
  • 6
  • 34
  • 43
12
votes
2 answers

CSS Only Pie Chart - How to add spacing/padding between slices?

I've built a CSS only pie chart, but I need to add space between each slice almost as if it were a border. I've attempted to add a border to each slice but that doesn't actually work. Any ideas on how to make this CSS pie chart look more like the…
stwhite
  • 3,156
  • 4
  • 37
  • 70