Post
by ranyeng » Tue May 26, 2009 7:43 am
Hi,
I am also facing the same problem. I cant display values at corresponding columns.... Following is part of my code
final JFreeChart chart = ChartFactory.createBarChart(
"Bar Chart Demo 3", // chart title
"Category", // domain axis label
"Value", // range axis label
dataset, // data
PlotOrientation.VERTICAL, // the plot orientation
false, // include legend
true,
false
);
chart.setBackgroundPaint(Color.lightGray);
// get a reference to the plot for further customisation...
final CategoryPlot plot = chart.getCategoryPlot();
final CategoryItemRenderer renderer = new CustomRenderer(
new Paint[] {Color.red, Color.blue, Color.green,
Color.yellow, Color.orange, Color.cyan,
Color.magenta, Color.blue}
);
renderer.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator("{2}",NumberFormat.getCurrencyInstance(Locale.US)));
renderer.setSeriesItemLabelsVisible(0, true);
Please help me...
Thanks,
Ranjan