我想在 XY 折线图上显示 X 值 如下所示: 我该怎么做? 我想像这样显示它: 这是我显示折线图的代码:
public class LineChartDemo6{
public static void main(String arg[]){
XYSeries series = new XYSeries("Average Weight");
series.add(20.0, 20.0);
series.add(40.0, 20.0);
series.add(55.0, 20.0);
series.add(70.0, 20.0);
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createXYLineChart
("XYLine Chart using JFreeChart", "Age", "Weight",
xyDataset, PlotOrientation.VERTICAL, true, true, false);
ChartFrame frame1=new ChartFrame("XYLine Chart",chart);
frame1.setVisible(true);
frame1.setSize(300,300);
}
}