Basically I have a grouped by report that has too many groups, so the pie chart has over 50 different pies. I know it doesn't really make sense to create a pie chart for such a report, but is there a better way to organize the labels so that the pie chart is more readable (other than completely removing them)? I did think of combining those after the top 10, or something like that, but in many cases that would be even worse because it's too evenly spread...
Asked
Active
Viewed 1,372 times
2
-
you can hide the labe in pie chart and only show the legend below – clevertension Mar 14 '12 at 01:26
1 Answers
3
A few ideas:
Do not add the (factory default)
StandardPieSectionLabelGenerator
.Do use
setLegendLabelGenerator()
to display those same labels in the legend.Do enable tooltips, possibly using a custom
StandardPieToolTipGenerator
.See also this answer about
MessageFormat
.
-
I looked at using a legend, but a similar problems arises. The legend becomes too massive. Instead of having the pie chart full of labels, now the legend is impossible to read. Any suggestions here? – Stephane Grenier Mar 15 '12 at 04:35
-
You can always invoke `getLegendItems()` and render the items in something like a `JList` or `JTable`. – trashgod Mar 15 '12 at 07:15
-
If I don't put pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2})")); a label is still drawn. How do you remove all labels? – Stephane Grenier Mar 16 '12 at 17:46
-
1
-