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

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

Introduction

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

Prototype

public void add(Number x, Number y, boolean notify) 

Source Link

Document

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

Usage

From source file:org.hxzon.demo.jfreechart.PolarChartDemo.java

private static XYDataset createDataset1() {

    boolean notify = false;
    XYSeriesCollection dataset = new XYSeriesCollection();
    XYSeries series1 = new XYSeries(series1Name);
    //(theta,radius)
    series1.add(10, 2, notify);
    series1.add(20, 4, notify);/*from   w  w w. j ava2  s  .c o m*/
    series1.add(30, 6, notify);
    dataset.addSeries(series1);
    return dataset;
}

From source file:org.fhcrc.cpl.viewer.mrm.Utils.java

public static void ArrayRefillPDS(PlotDataSupplier pds, float newVals[][]) {
    if (pds == null || newVals == null)
        return;/*from  w  ww  . j  av  a 2s .  c om*/
    XYSeries xys = pds.getGraphData();
    xys.clear();
    for (int i = 0; i < newVals[0].length; i++)
        xys.add(newVals[0][i], newVals[1][i], false);
}

From source file:org.fhcrc.cpl.viewer.mrm.Utils.java

public static XYSeries ArrayToXYSeries(float farr[][], Comparable name) {
    XYSeries retval = new XYSeries(name);
    if (farr == null || farr[0].length == 0 || farr.length != 2)
        return retval;
    for (int i = 0; i < farr[0].length; i++) {
        retval.add(farr[0][i], farr[1][i], false);
    }//from   w  w w  .j  ava2  s .  c  o  m
    return retval;
}

From source file:org.hxzon.demo.jfreechart.OtherDatasetDemo.java

private static XYDataset createPolarDataset() {
    boolean notify = false;
    XYSeriesCollection dataset = new XYSeriesCollection();
    XYSeries series1 = new XYSeries("series 1");
    //(theta,radius)
    for (int i = 0; i < 20; i++) {
        series1.add(i * 10, i * 10, notify);
    }/*from  w  ww. j  a  v a 2  s  .co  m*/
    dataset.addSeries(series1);
    return dataset;
}

From source file:de.mpg.mpi_inf.bioinf.netanalyzer.ui.charts.JFreeChartConn.java

/**
 * Converts the given point set to a data collection.
 * /*ww w  .  ja  v a  2s.c o  m*/
 * @param aPoints
 *            Set of points to be converted.
 * @return Data collection to be used in the creation of a chart.
 */
private static XYSeriesCollection fromPoints2D(Points2D aPoints) {
    Point2D.Double[] points = aPoints.getPoints();
    XYSeries dataSeries = new XYSeries("", true, true);
    for (int i = 0; i < points.length; ++i) {
        dataSeries.add(points[i].x, points[i].y, false);
    }
    return new XYSeriesCollection(dataSeries);
}

From source file:de.mpg.mpi_inf.bioinf.netanalyzer.ui.charts.JFreeChartConn.java

/**
 * Converts the given integer histogram data to a data collection.
 * /*  w  w w  .  ja  v  a  2 s. co  m*/
 * @param aHistogram
 *            IntHistgogram data to be converted.
 * @return Data collection to be used in the creation of a chart.
 */
private static XYSeriesCollection fromIntHistogram(IntHistogram aHistogram) {
    int[][] bars = aHistogram.getBins();
    XYSeries dataSeries = new XYSeries("", true, true);
    for (int i = 0; i < bars[0].length; ++i) {
        dataSeries.add(bars[0][i], bars[1][i], false);
    }
    return new XYSeriesCollection(dataSeries);
}

From source file:de.mpg.mpi_inf.bioinf.netanalyzer.ui.charts.JFreeChartConn.java

/**
 * Converts the given long histogram data to a data collection.
 * //from  w w w.  jav  a2s .  co m
 * @param aHistogram
 *            LongHistgogram data to be converted.
 * @return Data collection to be used in the creation of a chart.
 */
private static XYSeriesCollection fromLongHistogram(LongHistogram aHistogram) {
    long[][] bars = aHistogram.getBins();
    XYSeries dataSeries = new XYSeries("", true, true);
    for (int i = 0; i < bars[0].length; ++i) {
        dataSeries.add(bars[0][i], bars[1][i], false);
    }
    return new XYSeriesCollection(dataSeries);
}

From source file:com.bdb.weather.display.preferences.ColorPreferencePanel.java

private void createSeriesData() {
    for (int i = 0; i < dataset.getSeriesCount(); i++) {
        XYSeries series = dataset.getSeries(i);
        series.clear();//from www  .j  a  v  a2 s . co m
        for (int j = 0; j < 360; j++) {
            series.add(j / 360.0, Math.sin(Math.toRadians(j + (i * (360.0 / dataset.getSeriesCount())))),
                    false);
        }
        series.fireSeriesChanged();
    }
}