简体   繁体   English

JFreechart X和Y轴缩放

[英]JFreechart X and Y axis scaling

It's possible to set the axis scale values in jfreechart? 可以在jfreechart中设置轴刻度值吗? For example, I'd want X-axis scale 10 and Y-Axis scale 1. 例如,我想要X轴比例尺10和Y轴比例尺1。

You set the TickUnit , if you are using an XYPlot try this 您设置了TickUnit ,如果您使用的是XYPlot尝试以下操作

XYPlot plot = chart.getXYPlot();
NumberAxis xAxis = (NumberAxis) plot.getDomainAxis();
xAxis.setTickUnit(new NumberTickUnit(10));

NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
yAxis.setTickUnit(new NumberTickUnit(1));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM