PieChart: Legend and Plot colors don't match

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
alexV
Posts: 2
Joined: Wed Aug 03, 2016 10:39 am
antibot: No, of course not.

PieChart: Legend and Plot colors don't match

Post by alexV » Wed Aug 03, 2016 10:50 am

Hello everybody,

For my work i need to display piechart plots, but the order of colors doesn't work every time.
If i had four part (A,B,C,D) and they are almost the same (25%), colors will be red for A, blue for B, green for C and yellow for D. But if part A is extremely tiny in comparaison to the others, colors in legend will be same as before, but on the plot : B will be red,C blue and D green. I can't see the color of A because of is size.

Thank you for any help.

AlexV.

PS: Sorry for my bad english.

alexV
Posts: 2
Joined: Wed Aug 03, 2016 10:39 am
antibot: No, of course not.

Re: PieChart: Legend and Plot colors don't match

Post by alexV » Wed Aug 03, 2016 1:43 pm

Hi again,

some new informations, i know the source of the problem but i can't solve it.

For my chart i need to have the name on the tag and the name with values on the legend. So i make two charts one with only the name and the second with the name and the values. After i remove the legend of the first chart and add to it the legend of the second chart.

The problem is, when i remove the legend of the first chart, the plot reset it colors and if the value is 0%, it dosen't affect any color for it.

If A = 0% and B = 12%, the plot will set in red color instead of blue and A will not have any color.

The order of color is only right when i don't touch the original legend. Is there any trick to solve my problem ?

Thank again, AlexV

Locked