我正在使用
JFreeChart
,我想删除瀑布图中的左右空格。
这是我的图表现在的样子,其中红色波浪线展示了我要删除的空间。
知道如何删除这些空格吗?
ChartFactory.createWaterfallChart()
实例化了一个CategoryAxis
,只需设置相关的边距:
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setLowerMargin(0);
domainAxis.setUpperMargin(0);
附录:请注意,负值会使边距变小,如此处所示。
domainAxis.setLowerMargin(-0.05);
domainAxis.setUpperMargin(-0.05);