本文整理汇总了Java中org.jfree.data.xy.MatrixSeriesCollection.addSeries方法的典型用法代码示例。如果您正苦于以下问题:Java MatrixSeriesCollection.addSeries方法的具体用法?Java MatrixSeriesCollection.addSeries怎么用?Java MatrixSeriesCollection.addSeries使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.data.xy.MatrixSeriesCollection
的用法示例。
在下文中一共展示了MatrixSeriesCollection.addSeries方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testEquals
import org.jfree.data.xy.MatrixSeriesCollection; //导入方法依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
MatrixSeries s1 = new MatrixSeries("Series", 2, 3);
s1.update(0, 0, 1.1);
MatrixSeriesCollection c1 = new MatrixSeriesCollection();
c1.addSeries(s1);
MatrixSeries s2 = new MatrixSeries("Series", 2, 3);
s2.update(0, 0, 1.1);
MatrixSeriesCollection c2 = new MatrixSeriesCollection();
c2.addSeries(s2);
assertTrue(c1.equals(c2));
assertTrue(c2.equals(c1));
c1.addSeries(new MatrixSeries("Empty Series", 1, 1));
assertFalse(c1.equals(c2));
c2.addSeries(new MatrixSeries("Empty Series", 1, 1));
assertTrue(c1.equals(c2));
}
示例2: createNewSerie
import org.jfree.data.xy.MatrixSeriesCollection; //导入方法依赖的package包/类
@Override
protected void createNewSerie(final IScope scope, final String serieid) {
final ChartDataSeries dataserie = chartdataset.getDataSeries(scope, serieid);
final MatrixSeries serie = new MatrixSeries((String) dataserie.getSerieLegend(scope),
Math.max(1, this.getChartdataset().getYSeriesValues().size()),
Math.max(1, this.getChartdataset().getXSeriesValues().size()));
final XYPlot plot = (XYPlot) this.chart.getPlot();
final MatrixSeriesCollection firstdataset = (MatrixSeriesCollection) plot.getDataset();
if (!IdPosition.containsKey(serieid)) {
if (firstdataset.getSeriesCount() == 0) {
firstdataset.addSeries(serie);
plot.setDataset(0, firstdataset);
} else {
final MatrixSeriesCollection newdataset = new MatrixSeriesCollection();
newdataset.addSeries(serie);
jfreedataset.add(newdataset);
plot.setDataset(jfreedataset.size() - 1, newdataset);
}
plot.setRenderer(jfreedataset.size() - 1, (XYItemRenderer) getOrCreateRenderer(scope, serieid));
IdPosition.put(serieid, jfreedataset.size() - 1);
// System.out.println("new serie"+serieid+" at
// "+IdPosition.get(serieid)+" fdsize "+plot.getSeriesCount()+" jfds
// "+jfreedataset.size()+" datasc "+plot.getDatasetCount());
// TODO Auto-generated method stub
}
}