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
12
votes
2 answers

How to return only value in pie on apexcharts.js won't convert percent

I'm developing a website for a society and I am using apexCharts.js, I want to show a simple pie chart but when I display this, the value on dataLabel is a percent. I don't want to convert them into values, of course the true value is display when…
Barth.M
  • 129
  • 1
  • 1
  • 7
12
votes
7 answers

Add text inside the Doughnut chart of the React-Chartjs-2 box to react

I created a Donut chart, which works correctly but now I need to show the number 45 in the center of this, for example. Where should I indicate the text to be displayed and the coordinates? In the options of the chart? I'm using react…
NelbeDG
  • 425
  • 1
  • 7
  • 19
12
votes
1 answer

How can I create a pie chart where elements can belong to multiple slices?

I'm trying to visualize some data as a pie chart. My data is structured as a list of (Season, Int) tuples, where the integer represents the number of items that are available for a particular season. The difficulty is that one item can be in…
Bill
  • 44,502
  • 24
  • 122
  • 213
12
votes
2 answers

ggplot pie chart labeling

I am struggling with getting the pie chart labels correct. Looked around and thought that I could easily implement what mathematicalCoffee did. So far I have this code: ltr = LETTERS[seq( from = 1, to = 26)] wght = runif(length(ltr)) wght =…
AK88
  • 2,946
  • 2
  • 12
  • 31
12
votes
2 answers

How to increase size of pie segment on hover in d3

I created pie chart using d3. How to increase size of pie segment on hover? As you can see, green segment is so small so I want to change it size like red segment. How can I do this? My code: var w = 400; var h = 400; var r = h/2; var color =…
Valentin Blokhin
  • 515
  • 1
  • 6
  • 16
12
votes
1 answer

Plot data values inside pie charts slice

How to add a data values inside the slice in pie chart. Can any one help me in this? whether this is possible?
arun
  • 307
  • 2
  • 3
  • 9
12
votes
3 answers

Creating pie charts programmatically

How can I programmatically generate pie charts from java? I have some data that is processed by a program, then I want to create an image file (PNG, GIF, etc) that has a pie chart. Is there a library that does this, or at least which I can use to do…
Jakob Weisblat
  • 7,450
  • 9
  • 37
  • 65
11
votes
3 answers

Pie, bar, line: SVG/VML better than Canvas

I need to choose a library for "standard" charting: pies, lines and bars. From what I've read, it seems to me that the best format is SVG/VML, like Highcharts for example. SVG is becoming standard across all major browsers, now that IE 9 accepts it.…
Christophe
  • 27,383
  • 28
  • 97
  • 140
11
votes
1 answer

R Plotly pie chart custom colors

I have been struggling with this issue for days if someone can help me with. I have a table data which has a column 'results' with values "High", "Medium" or "low". I am trying to create a pie chart using plotly by counting the number of High,…
Manoj Agrawal
  • 775
  • 3
  • 8
  • 20
11
votes
3 answers

Show Pie chart in Android Application

I want to show pie chart in my android application like below: So any one idea about this how can I achieve this? If any library for that then please suggest me. Thank in advance.
Harshal Kalavadiya
  • 2,412
  • 4
  • 38
  • 71
11
votes
2 answers

Highcharts Pie Chart.How to set labels in two lines

I'm creating a pie chart in highcharts. Does anybody know how to set data labels in two lines? I'm finding this problem when the data labels are too long. http://jsfiddle.net/larrytron/fSjnD/ $(function () { $('#container').highcharts({ …
larrytron
  • 689
  • 4
  • 11
  • 26
11
votes
1 answer

jfreechart customize piechart to show absolute values and percentages

How can this compilable minimal code snippet example, which uses JFreeChart as plotting API, adapted in order to show both absoulte values AND percentages? I couldn't extract this information neither from any code snippet on the internet nor from…
kiltek
  • 3,183
  • 6
  • 47
  • 70
11
votes
2 answers

Preventing overlap of text in D3 pie chart

I've been googling around, but I can't seem to grasp this. My situation is that the countries overlap when presented on the pie chart: This is an example of what is happening: jsfiddle I am a total beginner to D3 and am trying to prevent text…
user1431282
  • 6,535
  • 13
  • 51
  • 68
10
votes
1 answer

Pie charts in ggplot2 with variable pie sizes

I've tried various ways to get a facet_grid of pie charts in ggplot2 to vary width/radii according to another variable (strength). geom_bar accepts width=0.5 as a parameter but it is ignored once coord_polar is added. Adding width=0.5 to the ggplot…
hurfdurf
  • 342
  • 1
  • 3
  • 9
10
votes
3 answers

Adjusting figure margins in Rmarkdown

I am trying to adjust the piechart figure in my Rmarkdown document so that it spans the width of the page or at least becomes wide enough to fit all of the labels. I have tried everything - adjusting figure.height and figure.width, margins with…
iskandarblue
  • 7,208
  • 15
  • 60
  • 130