A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
handsomeli
- Posts: 1
- Joined: Mon Dec 25, 2006 9:31 am
Post
by handsomeli » Mon Dec 25, 2006 9:38 am
hello:
i am new to jfree chart and i use version of 1.0.3
Now i can draw bar chart in 3D. But the label of some bars disappear when the string of the label is wider than the width of the bar.
How can i always show the label of each bar, no matter how long the string of the label is.
My code is as follows:
JFreeChart chart = ChartFactory.createBarChart3D(chartTitle,abscissaName,"",dataset,PlotOrientation.VERTICAL,true,false,false);
CategoryPlot plot = chart.getCategoryPlot();
BarRenderer3D renderer = new BarRenderer3D();
renderer.setBaseOutlinePaint(Color.BLACK);
renderer.setWallPaint(Color.gray);
renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
renderer.setItemLabelsVisible(true);
plot.setRenderer(renderer);
plot.setForegroundAlpha(0.8f);
Thank you very much![
-
demonhead
- Posts: 24
- Joined: Thu May 25, 2006 5:44 am
Post
by demonhead » Tue Dec 26, 2006 6:36 am
handsomeli wrote:hello:
i am new to jfree chart and i use version of 1.0.3
Now i can draw bar chart in 3D. But the label of some bars disappear when the string of the label is wider than the width of the bar.
How can i always show the label of each bar, no matter how long the string of the label is.
My code is as follows:
JFreeChart chart = ChartFactory.createBarChart3D(chartTitle,abscissaName,"",dataset,PlotOrientation.VERTICAL,true,false,false);
CategoryPlot plot = chart.getCategoryPlot();
BarRenderer3D renderer = new BarRenderer3D();
renderer.setBaseOutlinePaint(Color.BLACK);
renderer.setWallPaint(Color.gray);
renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator());
renderer.setItemLabelsVisible(true);
plot.setRenderer(renderer);
plot.setForegroundAlpha(0.8f);
Thank you very much![
You could always use:
Code: Select all
plot.setMaximumCategoryLabelLines(int noOfLines) ;