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

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

Introduction

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

Prototype


public void add(final double x, final double y, boolean notify) 

Source Link

Document

Adds a data item to the series and, if requested, sends a SeriesChangeEvent to all registered listeners.

Usage

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

/**
 * Adds a series represented in the given Collector.
 * // w  w  w. jav a 2  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);
    }
}