how to add item label with value of bar chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
avignon

how to add item label with value of bar chart

Post by avignon » Fri Feb 25, 2005 9:17 am

hi, all
how can i show the value of item label in each category of bar chart?

value: the data from database.

techlead_arun
Posts: 10
Joined: Fri Feb 25, 2005 5:55 pm
Contact:

Post by techlead_arun » Sat Feb 26, 2005 12:45 pm

chart = ChartFactory.createBarChart(chartName,categoryAxis.getLabel(),valueAxis.getLabel(),dataset,PlotOrientation.HORIZONTAL,true, true, false);

CategoryPlot catPlot = chart.getCategoryPlot();
CategoryItemRenderer CatItemRenderer = catPlot.getRenderer();
CategoryLabelGenerator generator = new StandardCategoryLabelGenerator();
CatItemRenderer.setLabelGenerator(generator);
CatItemRenderer.setItemLabelsVisible(true);

This should solve ur problem. chill..

Locked