jfreechart 柱图x坐标轴标签太密集,标签重叠了.
来源:学生作业帮 编辑:神马作文网作业帮 分类:综合作业 时间:2024/11/18 14:03:18
jfreechart 柱图x坐标轴标签太密集,标签重叠了.
JFreeChart chart = ChartFactory.createStackedBarChart3D("","","",dataset_bar,PlotOrientation.VERTICAL,true,true,false); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(Color.white); CategoryAxis categoryaxis = plot.getDomainAxis(); categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); categoryaxis.setMaximumCategoryLabelWidthRatio(5.0f); categoryaxis.setMaximumCategoryLabelLines(1); categoryaxis.setTickLabelsVisible(false); chart.setBackgroundImageAlpha(0.01F); categoryaxis.setTickMarksVisible(true); categoryaxis.setCategoryLabelPositionOffset(20); return chart;
JFreeChart chart = ChartFactory.createStackedBarChart3D("","","",dataset_bar,PlotOrientation.VERTICAL,true,true,false); CategoryPlot plot = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(Color.white); CategoryAxis categoryaxis = plot.getDomainAxis(); categoryaxis.setCategoryLabelPositions(CategoryLabelPositions.UP_45); categoryaxis.setMaximumCategoryLabelWidthRatio(5.0f); categoryaxis.setMaximumCategoryLabelLines(1); categoryaxis.setTickLabelsVisible(false); chart.setBackgroundImageAlpha(0.01F); categoryaxis.setTickMarksVisible(true); categoryaxis.setCategoryLabelPositionOffset(20); return chart;
你可以渲染一下图表啊,也可以设置横坐标的长度的