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

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

Introduction

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

Prototype

public String toString() 

Source Link

Document

Returns a string representation of the object.

Usage

From source file:svacee.form.Grafico.java

private XYDataset createDataset() {
    XYSeriesCollection dataset = new XYSeriesCollection();
    XYSeries Robo1 = new XYSeries("Robo 1");
    XYSeries Serra1 = new XYSeries("Serra  1");
    XYSeries Esteira1 = new XYSeries("Esteira  1");

    SimpleDateFormat simpleDateFormat = new SimpleDateFormat("HH.mm");

    for (Consumo c : consumoCtrl.getListaDados()) {
        System.out.println(c.getDataHora().toString() + " " + c.getIdColeta() + " " + c.getValor());
        if (c.getIdColeta().equalsIgnoreCase(" ROB 1")) {
            Robo1.add(Double.parseDouble(simpleDateFormat.format(c.getDataHora())), c.getValor());
            System.out.println(Robo1.toString());
        }/*from  w  w w . j a  v a  2s.c om*/
        if (c.getIdColeta().equalsIgnoreCase(" SERRA 1")) {
            Serra1.add(Double.parseDouble(simpleDateFormat.format(c.getDataHora())), c.getValor());
        }
        if (c.getIdColeta().equalsIgnoreCase(" ESTEIRA 1")) {
            Esteira1.add(Double.parseDouble(simpleDateFormat.format(c.getDataHora())), c.getValor());
        }
    }

    dataset.addSeries(Robo1);
    dataset.addSeries(Serra1);
    dataset.addSeries(Esteira1);

    return dataset;

}