gpt4 book ai didi

java - 碧 Jade 报告轴线粗细

转载 作者:行者123 更新时间:2023-11-29 04:50:53 26 4
gpt4 key购买 nike

我正在自定义 Jasper Reports 生成的默认图表,但找不到使轴线变粗的方法。

到目前为止,我很容易找到更改颜色的示例: http://www.jfree.org/forum/viewtopic.php?f=3&t=11639但这更容易被编辑器更改。

我附上一张图片来说明与当前厚度相比的预期厚度。

Current result

这是我当前的定制器:

public void customize(JFreeChart jFreeChart, JRChart jrChart) {

CategoryPlot plot = (CategoryPlot) jFreeChart.getPlot();
plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_LEFT);


BarRenderer barRenderer = (BarRenderer) plot.getRenderer();
barRenderer.setItemMargin(0.0);

NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
NumberFormat numberFormat= NumberFormat.getNumberInstance();
numberFormat.setMaximumFractionDigits(2);
numberFormat.setMinimumFractionDigits(2);
rangeAxis.setNumberFormatOverride(numberFormat);
rangeAxis.setUpperMargin(0.2);
rangeAxis.setAutoRange(true); //make sure that fixed range is not set
}

GitHub:https://github.com/MichaelKnight/jaspertest.git

最佳答案

设置Stroke CategoryAxisNumberAxis 在您的 customize 中添加以下代码:

CategoryAxis categoryAxis = plot.getDomainAxis();
categoryAxis.setAxisLineStroke(new BasicStroke(2f)); //see API link below for BasicStroke

NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setAxisLineStroke(new BasicStroke(2f));

BasicStroke API

关于java - 碧 Jade 报告轴线粗细,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35464980/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com