google / google-visualization-issues

288 stars 35 forks source link

Enhance Pie Charts to show percentage around slices #30

Open orwant opened 9 years ago

orwant commented 9 years ago
What would you like to see us add to this API?
Enhance Pie Charts to show percentage on slices or around slices.  It would
be great if the percentages could appear around the pie chart with lines
pointing to the slices or on the slices themselves.  Putting them on the
slices may not be a good thing in cases where the slices are small.

What component is this issue related to (PieChart, LineChart, DataTable,
Query, etc)?
PieChart

*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Original issue reported on code.google.com by fvillaj on 2009-08-14 01:48:02

orwant commented 9 years ago
Nice idea.

A workaround for now will be to add the percentage to the formatted value of each value.
So you can run some code on the data table, and setting the formatted value of a cell
with value of 30, to "30 
(20%)"

I know its not perfect, but it will work.

Original issue reported on code.google.com by razbarvaz on 2009-08-18 15:13:46

orwant commented 9 years ago
Thanks for the suggestion.  Although, I think the formatted value only affects the 
tooltip, which already contains the percentage.  In my scenario, I was trying to 
avoid having to click on the slice in order to see the percentage of the slice.

Original issue reported on code.google.com by fvillaj on 2009-08-20 00:00:22

orwant commented 9 years ago
If you add the percentage to the formatted value, you will end up getting a duplicate
when clicking on the slice.

Original issue reported on code.google.com by ledawit on 2010-01-05 22:49:00

orwant commented 9 years ago
I wanted to get exactly the same thing as fvillaj described. It would really be more
convenient for users to instantly see the percentage around the slices instead of
having to click them one by one. 

Original issue reported on code.google.com by reality.is.reality on 2010-05-12 07:26:44

orwant commented 9 years ago
The corechart's pie chart now have an option to show the percentage on the slices (not
around them with connecting lines).

Original issue reported on code.google.com by jinji.viz on 2010-11-10 12:33:50

orwant commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by jinji.viz on 2010-12-23 10:11:45

orwant commented 9 years ago
Was this functionality documented somewhere?  I can't seem to find it on any of the
API pages.  Thanks in advance.

Original issue reported on code.google.com by jldimasuay on 2011-04-18 16:23:24

orwant commented 9 years ago
It's documented in http://code.google.com/apis/visualization/documentation/gallery/piechart.html#Configuration_Options,
the 'pieSliceText' option, but it's actually the default, so you're supposed to see
it immediately.

Original issue reported on code.google.com by jinji.viz on 2011-04-20 07:55:53

orwant commented 9 years ago
Yeah that would be usefull, or maybe a combination between the label and the percentage
/ amount? 

pieSliceText: "%percentage% (%value%) - %label%"

Something like that would really give us all the freedom we like :)

Original issue reported on code.google.com by nbijl@networthnet.com on 2013-10-22 13:09:10


ghost commented 7 years ago

I feel pieslicetext should always show, if the slice is too small, it should show outside with a line into the slice. We are doing reporting by pdf'ing the svg of google charts, and while the tooltips expose small slice values with moue over, that is not possible in a pdf, so it's hard to get good pdf reports without pieslicetext showing somewhere without a tooltip.

destan commented 7 years ago

as @hir3npatel stated, invisible pieSliceText is a deal-breaker for pdf reports as no interaction is possible.

Following may give developers an idea about how it should seem when pieSliceText doesn't fit into the slice: http://www.highcharts.com/demo/pie-basic

image

ghost commented 7 years ago

@orwant or @dlaliberte is there anything in the pipeline to fix this? Activity on this repo seems very low, makes one think there's nothing going on around google charts, or no resources on it :-/