[英]Java jasper reports valueAxis position
我想將valueAxis(bar)更改為堆疊欄的右側。 我一直在努力改變它,因為一旦我改變了位置,我就會改變方向。
請在我的資料下面找到
<barPlot>
<plot orientation="Horizontal">
<seriesColor seriesOrder="0" color="#FFFF80"/>
<seriesColor seriesOrder="1" color="#FF8000"/>
<seriesColor seriesOrder="2" color="#F47A00"/>
</plot>
<itemLabel/>
<categoryAxisFormat>
<axisFormat/>
</categoryAxisFormat>
<valueAxisFormat>
<axisFormat/>
</valueAxisFormat>
</barPlot>
您可以向圖表添加圖表定制器以進行修改。 在此處了解有關操作方法的信息: http : //mdahlman.wordpress.com/2010/08/18/chart-customizers-1/
您需要更改軸位置的命令是setRangeAxisLocation 。
plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
因此您的定制器將如下所示:
public class myCustomizer implements JRChartCustomizer {
public void customize(JFreeChart chart, JRChart jasperChart) {
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_RIGHT);
}
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.