1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| // utilisateur 1
XYSeries series = new XYSeries("utilisateur1Periode1");
series.add(1, 1);
series.add(2, 1);
XYSeries series2 = new XYSeries("utilisateur1Periode2");
series2.add(3, 1);
series2.add(5, 1);
// utilisateur 2
XYSeries series3 = new XYSeries("utilisateur2Periode1");
series3.add(2, 2);
series3.add(5, 2);
XYSeries series4 = new XYSeries("utilisateur2Periode2");
series4.add(6, 2);
series4.add(8, 2);
XYSeriesCollection seriesCollection = new XYSeriesCollection();
seriesCollection.addSeries(series);
seriesCollection.addSeries(series2);
seriesCollection.addSeries(series3);
seriesCollection.addSeries(series4);
JFreeChart chart = ChartFactory.createXYLineChart("Periodes",
"Periode", "Utilisateur", seriesCollection,
PlotOrientation.VERTICAL, true, true, false); |
Partager