Hi,
I want to know how can I assign different colors to bars in a bar chart? The data belongs to only one series.
Thanks,
Bar Chart Colors
I think I saw a post about this issue, anyway the idea is to override the bar renderer's getItemPaint and setItemPaint using an array which contains the colors. I'm using it. It works like a charm.
Code: Select all
private transient Paint paintArray[][];
private boolean isPaintArray = false;
public Paint getItemPaint(int row, int column) {
Paint returnPaint = null;
if (isPaintArray) {
returnPaint = paintArray[row][column];
} else {
returnPaint = super.getItemPaint(row, column);
}
return returnPaint;
}