[英]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.