JFreechart X和Y轴缩放 [英] JFreechart X and Y axis scaling
本文介绍了JFreechart X和Y轴缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否可以在jfreechart中设置轴刻度值? 例如,我想要X轴比例尺10和Y轴比例尺1.
It's possible to set the axis scale values in jfreechart? For example, I'd want X-axis scale 10 and Y-Axis scale 1.
推荐答案
如果您使用的是XYPlot
,请设置TickUnit
You set the TickUnit
, if you are using an XYPlot
try this
XYPlot plot = chart.getXYPlot();
NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
xAxis.setTickUnit(new NumberTickUnit(10));
NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setTickUnit(new NumberTickUnit(1));
这篇关于JFreechart X和Y轴缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文