Wrap text inside RingChart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
3rl
Posts: 1
Joined: Tue Oct 08, 2019 2:22 pm
antibot: No, of course not.

Wrap text inside RingChart

Post by 3rl » Tue Oct 08, 2019 2:49 pm

I'm trying to use jfreechart library to create ring chart, it's working fine but there's a little thing that I can't achieve properly when drawing the ring chart. The jfreechart's ring chart can't wrap the text inside the ring, it will put the text line in the center horizontally. So, I checkout the code from github and found that in TextUtils.java, the drawAlignedString() method using Graphics2d.drawString() to draw where it has limitation for wrap text.

So, could you please give me pointers (or proper way) to be able to customize the TextUtils.java in order to create ring chart that has text wrapped dynamically?

For example, I want the centered text wrapped dynamically like in this chart: Image

Locked