Pie section outlines overlapping

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
conwaypm
Posts: 11
Joined: Wed Dec 21, 2011 2:49 pm
antibot: No, of course not.

Pie section outlines overlapping

Post by conwaypm » Thu Jun 14, 2012 11:09 am

Hi. We currently have a problem of pie section outlines overlapping for particularly narrow slices. The overlapping tends to become worse the closer to the center of the pie as the edges converge.

One possible way I thought of lessening this effect is having the outlines taper as they get closer to the center of the pie (sort of like mini pie sections themselves). However I'm not sure how/whether this can be achieved? I have looked at the JFC source code but can't quite figure out where it is constructing the outline shapes and drawing.

If anyone could give me some guidance on this then it would be greatly appreciated.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Pie section outlines overlapping

Post by matinh » Thu Jun 14, 2012 11:53 am

Hi!

I'm not sure I completely understand your problem. Could you eventually post an image?
Regarding the code, you are probably searching for PiePlot.drawItem().

hth,
- martin

conwaypm
Posts: 11
Joined: Wed Dec 21, 2011 2:49 pm
antibot: No, of course not.

Re: Pie section outlines overlapping

Post by conwaypm » Thu Jun 14, 2012 1:18 pm

Hi Martin. Here is a picture. You see the really really thin wedge at the 12 o'clock position? The white borders overlap more and more the closer they get to the center. I think the problem would be alleviated slightly by having these outlines get thinner as they get to the center of the pie. Hope this helps explain the problem better.

Image

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Re: Pie section outlines overlapping

Post by matinh » Thu Jun 14, 2012 1:48 pm

Your problem is clear now. You could try to completely disable outlines, but that might not be what you want.
If you want to try to fix this yourself, have a look at the method I already pointed to. It should be a good starting point. And consider contributing your changes back, if you find a solution.

hth,
- martin

Locked