Pie charts- display percent but not count?

69 views
Skip to first unread message

Charles Hartley

unread,
Feb 8, 2014, 3:59:34 PM2/8/14
to sofasta...@googlegroups.com
Hi Grant,

YASQ (yet another SOFA question).

Is it possible to show only count or percentage in a pie chart?  I ask because I find the percentage sufficient and "more appropriate" for a pie chart (though this is probably just a preference!!), and I was wondering if there is a way to only display the percentage. Perhaps comment out a line of code, or comment out and replace with a new line (so that I could return to count and percentage later as needed).

Thanks again for all your help!!

Best,
Charles

Grant Paton-Simpson

unread,
Feb 8, 2014, 5:33:46 PM2/8/14
to sofasta...@googlegroups.com
Hi Charles,

charting_output.py

line 1803

Change from

tooltip = u"%s<br>%s (%s%%)" % (tiplbl, int(y_val), slice_pct)

to

tooltip = u"%s<br>%s%%" % (tiplbl, slice_pct)

Or better yet, comment out the original and edit a copy so you easily
swap back by commenting out the second line and uncommenting the first:

#tooltip = u"%s<br>%s (%s%%)" % (tiplbl, int(y_val), slice_pct)
tooltip = u"%s<br>%s%%" % (tiplbl, slice_pct)

All the best,
Grant
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "sofastatistics" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sofastatistic...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Charles Hartley

unread,
Feb 8, 2014, 7:19:24 PM2/8/14
to sofasta...@googlegroups.com
Fantastic, thanks again Grant!  Yes, exactly what I was thinking, having both lines of code and commenting out the line I didn't want.

Cheers,
Charles
Reply all
Reply to author
Forward
0 new messages