Item labels in Stacked bar chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
senthil
Posts: 12
Joined: Thu Apr 17, 2008 8:48 am

Item labels in Stacked bar chart

Post by senthil » Fri Nov 14, 2008 3:26 pm

I dont see the Item labels in the stacked bar chart, in few cases. What could be the problem :?:. Anyone else ?

StackedBarRenderer renderer = (StackedBarRenderer)categoryPlot.getRenderer();
CategoryItemLabelGenerator labelGenerator = new StandardCategoryItemLabelGenerator("{2}",new DecimalFormat("0.000"));
renderer.setBaseItemLabelGenerator(labelGenerator);
renderer.setBaseItemLabelsVisible(true);
renderer.setMaximumBarWidth(0.10);
renderer.setDrawBarOutline(false);

david.gilbert
JFreeChart Project Leader
Posts: 11732
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Mon Nov 17, 2008 10:49 am

If the item labels are too big to fit inside the bars, they're not displayed. You can override that by calling setPositiveItemLabelPositionFallback(). See ItemLabelDemo5.java in the JFreeChart Demo Collection for an example.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Ask your company to buy the JFreeChart Developer Guide

Post Reply