I see that I can use setLabelLinkPaint()
to universally apply a color to all label links, but I'm looking to set each individual label link to a different color. Is there a way to do this?
Asked
Active
Viewed 66 times
0

esteemedtogami
- 11
- 4
-
I don't see any support for this. – trashgod Sep 04 '22 at 13:43
1 Answers
1
It looks like for now the most straightforward way to approach this problem is to subclass the PiePlot
class and override the drawRightLabel
and drawLeftLabel
methods. In my case, I needed to have the label link color match the corresponding pie chart section, so in my overridden methods I set g2.setPaint(getSectionPaint(record.getKey()))
.
My advice to anyone trying to do something similar is to watch out for casting errors if casting from a JFreeChart
chart object. You will likely have to additionally subclass ChartFactory
and modify it so that it uses your subclassed PiePlot
and not the original one.

esteemedtogami
- 11
- 4