how to paint different bars in different colors, I tried to use renderer, here is my sample code:
public IntervalXYDataset createDataset() throws Interrupted
What you want to do is the following:
XYPlot plot = (XYPlot) chart.getPlot();
plot.getRenderer().setSeriesPaint(1, Color.yellow);
Replace 1 with the (zero-based) index of the bar whose color you would like to change.
Edit to respond to comment:
List myBarColors = .....
XYPlot plot = (XYPlot) chart.getPlot();
XYItemRenderer renderer = plot.getRenderer();
for (int i = 0; i < 40; i++) {
renderer.setSeriesPaint(i, myBarColors.get(i));
}
Edit 2: Misunderstood OPs problem, new solution in comments.