Example usage for org.jfree.data.xy FastXYSeries FastXYSeries

List of usage examples for org.jfree.data.xy FastXYSeries FastXYSeries

Introduction

In this page you can find the example usage for org.jfree.data.xy FastXYSeries FastXYSeries.

Prototype


public FastXYSeries(String name) 

Source Link

Document

Creates a new empty series.

Usage

From source file:de.uniol.ui.tsv.ui.LineChartDialog.java

/**
 * Adds a series represented in the given Collector.
 * //  w  w  w.j a  v  a2 s  .  c o  m
 * @param name
 * @param data
 */
public void addSeries(String name, double[][] data) {
    if (xy instanceof FastXYDataset) {
        FastXYSeries series = new FastXYSeries(name);
        for (int i = 0; i < data[0].length; i++) {
            boolean notify = i == data[0].length - 1;
            series.add(data[0][i], data[1][i], notify);
        }
        ((FastXYDataset) xy).addSeries(series);
    } else if (xy instanceof DefaultXYDataset) {
        ((DefaultXYDataset) xy).addSeries(name, data);
    }
}