【发布时间】:2018-01-18 18:51:31
【问题描述】:
我正在开发堆积面积图,它在绘图时出现问题。我需要使用精确的 x 轴值开始和结束绘图,但目前我的图表使用 x 轴值的中间绘制。
当前输出:
红色值需要以Type 3位置结束和开始。
enter code here:
chart.setBackgroundPaint(Color.white); 最终 CategoryPlot 图 = (CategoryPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); 最终 CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setLowerMargin(0.0); domainAxis.setUpperMargin(0.0); final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); 最终 CategoryItemRenderer 渲染器 = plot.getRenderer(); renderer.setItemLabelsVisible(true);
【问题讨论】:
-
您是否有类似的东西,以便读者可以看到您的代码并提出修改建议?
-
^ 请从 cmets 中删除它,并使用提供的格式化工具将其编辑到您的问题中。如果你能解释它的作用,以及它与你的要求有何不同,那就太好了。
-
很难说没有sscce 有什么问题,但这可能是因为您对类型 3 的绿色系列有一个价值,或者您使用的是类别而不是 XY 系列
标签: jfreechart