I need to draw a graph so that on the x axis there will be "i" data, and on the y axis there will be "massAngle [i]" data. I tried to do it this way:
for (int i = 0; i < massAngle.length; i++) {
XYSeries series = new XYSeries("1");
series.add(i, massAngle[i]);
XYSeriesCollection seriesCollection = new XYSeriesCollection(series);
final JFreeChart chart = ChartFactory.createXYLineChart("Долгота и Широта",
"Долгота", "Широта", seriesCollection, PlotOrientation.VERTICAL, true, true, false);
final ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPreferredSize(new Dimension(1150, 470));
panel.add(chartPanel);
}