jfreechart 柱图x坐标轴标签太密集,标签重叠了.
来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/06/25 05:29:14
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;
![](http://img.wesiedu.com/upload/2/98/298a3afe5d9648c910835754c37f75f5.jpg)
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;
![](http://img.wesiedu.com/upload/2/98/298a3afe5d9648c910835754c37f75f5.jpg)
![jfreechart 柱图x坐标轴标签太密集,标签重叠了.](/uploads/image/z/17729235-27-5.jpg?t=jfreechart+%E6%9F%B1%E5%9B%BEx%E5%9D%90%E6%A0%87%E8%BD%B4%E6%A0%87%E7%AD%BE%E5%A4%AA%E5%AF%86%E9%9B%86%2C%E6%A0%87%E7%AD%BE%E9%87%8D%E5%8F%A0%E4%BA%86.)
你可以渲染一下图表啊,也可以设置横坐标的长度的