hi,
i would like to put a specific color on one and only one bar of my bar chart which contains only one serie. is it possible? i have found a lot of examples allowing to color a complete serie but this is not what i am trying to do.
thanks a lot
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi,
i would like to put a specific color on one and only one bar of my bar chart which contains only one serie. is it possible? i have found a lot of examples allowing to color a complete serie but this is not what i am trying to do.
thanks a lot
You will have to extend the BarRenderer and use that class to modify the color of the bars.
How do you change the BarRenderrer?
public class ExtendedStackedXYBarRenderer extends StackedXYBarRenderer
{
/** Farben fr die Items */
private Paint[][] paintArray = null;
/** Sollen die Farben der einzelnen Items genutzt werden? */
private boolean isPaintArray = false;
public void setItemPaint(Paint paint, int row, int column)
{
this.paintArray[row][column] = paint;
}
public Paint getItemPaint(int row, int column)
{
Paint returnPaint = null;
if (this.isPaintArray)
{
returnPaint = this.paintArray[row][column];
}
else
{
returnPaint = super.getItemPaint(row, column);
}
return returnPaint;
}
}