Pie Section Color Problem

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
cagatay_civici
Posts: 54
Joined: Sun Aug 28, 2005 8:13 pm

Pie Section Color Problem

Post by cagatay_civici » Mon May 07, 2007 9:35 am

Hi,

I've just upgraded the JFreeChart version of JSF Chart Creator to 1.0.5 and faced with a pie section color problem.

setSectionPaint(int i, Color color) is deprecated and replaced with
setSectionPaint(Comparable i, Color color).

Problem is when I use something like setSectionPaint(new Integer(i), Color.Black) it does not work.

Regards,

Cagatay

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue May 08, 2007 11:03 am

The Comparable parameter in the new method is a dataset key - you associate the Paint for a section with the section's key (rather than its index, as before). This allows the dataset to be reordered easily, without having to reorder the section attributes simultaneously.

With hindsight, this change is a bit disruptive and probably should have been held for the 1.2.x series...but a client needed it, so I did it.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked