Overlaping the X-axis lables when using CategoryAxis

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

Overlaping the X-axis lables when using CategoryAxis

Post by jfreechart-200608 » Tue Oct 04, 2005 10:29 am

Overlaping the X-axis lables when using CategoryAxis to Generate BAR Graph.

Please check the screen shot.

I am using the following code

// Create the chart object
CategoryAxis categoryAxis = new CategoryAxis("");
categoryAxis.setVisible(isGraph);
categoryAxis.setLowerMargin(0.0);
categoryAxis.setUpperMargin(0.0);
categoryAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
categoryAxis.setTickLabelsVisible(true);

ValueAxis valueAxis = new NumberAxis("");
valueAxis.setVisible(isGraph);
valueAxis.setLowerMargin(0.0);
valueAxis.setLowerBound(lowerBound);
valueAxis.setUpperBound(upperBound+50.00);
valueAxis.setAxisLinePaint(java.awt.Color.black);

BarRenderer renderer = new BarRenderer();
renderer.setMinimumBarLength(2.0);
renderer.setMaxBarWidth(5.0);

CategoryPlot plot = new CategoryPlot(dataset, categoryAxis, valueAxis, renderer);
plot.setForegroundAlpha(0.65f);
JFreeChart chart = new JFreeChart("",JFreeChart.DEFAULT_TITLE_FONT, plot, false);
[/url]

poppins
Posts: 10
Joined: Thu Sep 01, 2005 12:17 pm
Location: India

Overlaping the X-axis lables when using CategoryAxis

Post by poppins » Tue Oct 04, 2005 12:58 pm

Try "categoryAxis.setCategoryMargin(x)" to allow some gap between categories if you are using a CategoryPlot.

jfreechart-200608

Re: Overlaping the X-axis lables when using CategoryAxis

Post by jfreechart-200608 » Thu Oct 20, 2005 7:40 am

poppins wrote:Try "categoryAxis.setCategoryMargin(x)" to allow some gap between categories if you are using a CategoryPlot.
No it is not working! Example of my problem is we can use TickUnits on DateAxis what is the equalent in CategoryAxis

Locked