
I'm creating the dataset like this
Code: Select all
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
dataset.addValue(value, Name, "1 to 2 second bin");
//there will be several bins of various timeframe like 2 to 3 second 3 to 4
//second and so on
Code: Select all
JFreeChart chart = ChartFactory.createBarChart3D("Histogram (Per Module)", // chart title
"Time frame in seconds", // domain axis label
"Hit count", // range axis label
dataset, // CategoryDataset
PlotOrientation.VERTICAL, // orientation
true, // include legend
true, // tooltips
false // urls
);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
CategoryItemRenderer renderer = plot.getRenderer();
renderer.setSeriesPaint(0, Color.RED);
BarChart3DDemo3.java in the demo kit is the one that matches closely with this. I wanted the series colors to be same every time i recreate it. If there are some series missing at some point the colors will vary, which is the issue that i'm talking about. I hope the issue is been said clearly, please give me a shout if you need more info...
Cheers