#1029 XYPlot::getSeriesPaint(int series) --> always returns null

open
nobody
None
5
2012-11-27
2011-02-07
Trevor B Smith
No

I was trying to query the paint used for a series... so that I could make multiple charts the same color (good look and feel if they are the same paint).

I tried using XYPlot::getSeriesPaint(int series) and it always returns null. I dug around in the code and ended up finding AbstractRenderer was trying to do the same thing for it's "getItemPaint(int row, int col). When it kept getting null it used another method to get the paint color it needed.

When i put a breakpoint i saw that getItemPaint worked --> so my solution was: use getItemPaint() instead of getSeriesPaint().

NOTE: getSeriesPaint() does return non-null sometimes. For example, if you use setSeriesPaint() then call getSeriesPaint() you get non-null... but i didn't want to do that.

Discussion