Item labels in Stacked bar chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Post Reply
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"));

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

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 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