使用Customiser图表类的步骤是什么?
我想在我的报告中自定义图表(使用 jasperReport 和 iReport 4.0),此类最小化比例,我怎样才能在每个条形的顶部添加值并在 X 轴上垂直写入属性,因为它们是重叠的(看看附上图表,一团糟)?
这是类:
public class ChartCustomiser implements JRChartCustomizer{
@Override
public void customize(JFreeChart jfc, JRChart jrc) {
CategoryPlot plot = (CategoryPlot)jfc.getPlot();
ValueAxis verticalAxis = plot.getRangeAxis();
TickUnits verticalTicks = new TickUnits();
verticalTicks.add(new NumberTickUnit(1));
verticalTicks.add(new NumberTickUnit(2));
verticalTicks.add(new NumberTickUnit(5));
verticalTicks.add(new NumberTickUnit(10));
verticalAxis.setStandardTickUnits(verticalTicks);
throw new UnsupportedOperationException("Not supported yet.");
}
}
我想要一个如下所示的图表:
I want to customised my charts in my reports (using jasperReport and iReport 4.0) ,this class minimise the scale ,how can I also add value on top of each bar and write the properity on X axis vertically because their are overlapping (look at the attach chart it's a mess)?
this is the class:
public class ChartCustomiser implements JRChartCustomizer{
@Override
public void customize(JFreeChart jfc, JRChart jrc) {
CategoryPlot plot = (CategoryPlot)jfc.getPlot();
ValueAxis verticalAxis = plot.getRangeAxis();
TickUnits verticalTicks = new TickUnits();
verticalTicks.add(new NumberTickUnit(1));
verticalTicks.add(new NumberTickUnit(2));
verticalTicks.add(new NumberTickUnit(5));
verticalTicks.add(new NumberTickUnit(10));
verticalAxis.setStandardTickUnits(verticalTicks);
throw new UnsupportedOperationException("Not supported yet.");
}
}
I want a chart look like this:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以试试这个:
you can try this: