I am using CategoryPlot in my application.
The thing is I can use "categoryaxis.setCategoryMargin(450);"
to avoid the label get overlapped (warpped) since there are too many data I have to show.
But the plotArea seems to be still fixed-sized, actually the whole CategoryPlot except the label is still the same.
I have tried many ways but just can't go on, can anyone help on this issue?
Code: Select all
CategoryAxis categoryaxis = new CategoryAxis();
categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.STANDARD);
categoryaxis.setMaximumCategoryLabelWidthRatio(5F);
categoryaxis.setCategoryMargin(450);
LineAndShapeRenderer lineandshaperenderer = new LineAndShapeRenderer();
lineandshaperenderer.setBaseLinesVisible(false);
lineandshaperenderer.setBaseToolTipGenerator(new StandardCategoryToolTipGenerator());
NumberAxis numberaxis = new NumberAxis("Value");
CategoryPlot categoryplot = new CategoryPlot(categoryDataset, categoryaxis, numberaxis, lineandshaperenderer);
categoryplot.setDomainGridlinesVisible(true);
categoryplot.setOrientation(PlotOrientation.HORIZONTAL);
JFreeChart jfreechart = new JFreeChart("", new Font("SansSerif", 1, 12), categoryplot, true);
George