Hi
I want to copy the chart from page 23 of the developer guide (Figure 2.4).
The demo source code produces a chart with the white glow line.
I want vertical gradients and can see there are method to do this, but they all require the colours to be defined.
I.e. i want default colours but with dark to light shading.
Is this possible?
Cheers
Gradient fill bar chart with default colours
Re: Gradient fill bar chart with default colours
...Update.
Ive managed to achieve what i wanted with this code snipet;
Is this wise or is there a better way!?
Ive managed to achieve what i wanted with this code snipet;
Code: Select all
CategoryPlot plot1 = (CategoryPlot) chart1.getPlot();
BarRenderer renderer1 = (BarRenderer) plot1.getRenderer();
renderer1.setDefaultBarPainter(new StandardBarPainter());
renderer1.setBarPainter(new StandardBarPainter());
renderer1.setDrawBarOutline(false);
int cc = dataset.getRowCount();
for (int c = 0; c <= cc; c++){
Color col = (Color) renderer1.getItemPaint(c,0);
renderer1.setSeriesPaint(c, new GradientPaint(0.0f, 0.0f, col, 0.0f, 0.0f, col.darker().darker()));
}
renderer1.setGradientPaintTransformer(
new StandardGradientPaintTransformer(
GradientPaintTransformType.VERTICAL));