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]
Overlaping the X-axis lables when using CategoryAxis
Overlaping the X-axis lables when using CategoryAxis
Try "categoryAxis.setCategoryMargin(x)" to allow some gap between categories if you are using a CategoryPlot.
Re: Overlaping the X-axis lables when using CategoryAxis
No it is not working! Example of my problem is we can use TickUnits on DateAxis what is the equalent in CategoryAxispoppins wrote:Try "categoryAxis.setCategoryMargin(x)" to allow some gap between categories if you are using a CategoryPlot.