0
的顏色我有3個系列:更改線條樣式和JFreeChart的
XYSeries s1 = new XYSeries("one");
s1.add(1,0);
s1.add(2,1);
XYSeries s2 = new XYSeries("two");
s1.add(3,0);
s1.add(4,1);
XYSeries s3 = new XYSeries("three");
s1.add(5,0);
s1.add(6,1);
我繪製的XYLineChart:
XYSeriesCollection dataset = new XYSeriesCollection();
dataset.addSeries(s1);
dataset.addSeries(s2);
dataset.addSeries(s3);
JFreeChart chart = ChartFactory.createXYLineChart("title", "x", "y", dataset, PlotOrientation.VERTICAL, false, false, false);
,並添加到面板:
ChartPanel cp = new ChartPanel(chart);
panel_1.add(cp, BorderLayout.CENTER);
panel_1.validate();
我該如何讓系列s1和s2是同一種顏色,s3是不同的?