Example usage for org.jfree.data.time Second Second

List of usage examples for org.jfree.data.time Second Second

Introduction

In this page you can find the example usage for org.jfree.data.time Second Second.

Prototype

public Second() 

Source Link

Document

Constructs a new Second, based on the system date/time.

Usage

From source file:ioheater.ui.IOHeaterUI.java

private void plotOnChart(float temperature) {
    this.dataSet.getSeries(0).addOrUpdate(new Second(), temperature);
}

From source file:biometricgui.MainWindow.java

private XYDataset createDataset() {
    final TimeSeries series = new TimeSeries("Biometric Data");
    Second current = new Second();
    double value = 100.0;

    for (int i = 0; i < 4000; i++) {

        try {/* w ww .  j a  v a 2 s.co  m*/
            value = value + Math.random() - 0.5;
            series.add(current, new Double(value));
            current = (Second) current.next();
        } catch (SeriesException e) {
            System.err.println("Error adding to series");
        }
    }

    return new TimeSeriesCollection(series);
}

From source file:beproject.MainGUI.java

private TimeSeriesCollection timeLinePlot() {
    final TimeSeries relaxed = new TimeSeries("Relaxed");
    final TimeSeries happy = new TimeSeries("Happy");
    final TimeSeries unhappy = new TimeSeries("Unhappy");
    final TimeSeries upset = new TimeSeries("Upset");
    int r = 0, h = 0, u = 0, p = 0;
    ResultSet rs = null;//Regression.getOneHourTweets(15, movieName);
    try {/*from ww w . ja v a  2  s  . co m*/
        while (rs.next()) {
            int tmp = rs.getInt(4);
            if (tmp > 0.5) {
                r++;
            } else if (tmp >= 0) {
                h++;
            } else if (tmp > -0.5) {
                u++;
            } else {
                p++;
            }
        }
    } catch (SQLException e) {

    }
    relaxed.add(new Second(), r);
    happy.add(new Second(), h);
    unhappy.add(new Second(), -u);
    upset.add(new Second(), -p);

    final TimeSeriesCollection dataset = new TimeSeriesCollection();
    dataset.addSeries(relaxed);
    dataset.addSeries(happy);
    dataset.addSeries(unhappy);
    dataset.addSeries(upset);
    return dataset;
}

From source file:beproject.MainGUI.java

void addRateObservation(double i) {
    rate.addOrUpdate(new Second(), i);
}