Package org.jfree.data.xy

Examples of org.jfree.data.xy.XYSeries


      return false;
    }
   
    for(int x=0; x<this.dataSet.getSeriesCount(); x++)
    {
      XYSeries serie = this.dataSet.getSeries(x);

      if (util.Util.compareArraysByValue(input, serie.toArray()[0]))
      {
        return true;
      }
    }
   
View Full Code Here


      return false;
    }
   
    for(int x=0; x<this.dataSet.getSeriesCount(); x++)
    {
      XYSeries serie = this.dataSet.getSeries(x);

      if (((String)serie.getKey()).compareTo(input.toString()) == 0)
      {
        return true;
      }
    }
   
View Full Code Here

   * @param inputs - X-series
   * @param outputs- Y-series
   */
  public void addXYSeries(double[] inputs, double[] outputs)
  {
    XYSeries data = new XYSeries(inputs.toString());
   
    for (int x=0; x<outputs.length; x++)
    {
      data.add(inputs[x], outputs[x]);
    }
   
    if (this.contains(inputs) == false || this.CONTAINS_DUPLICATES == false)
    { 
      this.dataSet.addSeries(data);
View Full Code Here

{

  public XYOdorInputVOutputJGraph(Odor input, double[] outputs)
  {
    dataSet = new XYSeriesCollection();
    XYSeries data = new XYSeries(input.toString());
   
    double[] inputs = input.getInputs();
   
    for (int x=0; x<outputs.length; x++)
    {
      data.add(inputs[x], outputs[x]);
    }
   
    dataSet.addSeries(data);
   
    super.makeChart();
View Full Code Here

    super.makeChart();
  }
 
  public void addXYSeries(Odor input, double[] outputs)
  {
    XYSeries data = new XYSeries(input.toString());
    double[] inputs = input.getInputs();
   
    for (int x=0; x<outputs.length; x++)
    {
      data.add(inputs[x], outputs[x]);
    }
   
    if (this.contains(input) == false)
    { 
      this.dataSet.addSeries(data);
View Full Code Here

      return false;
    }
   
    for(int x=0; x<this.dataSet.getSeriesCount(); x++)
    {
      XYSeries serie = this.dataSet.getSeries(x);

      if (((String)serie.getKey()).compareTo(input.toString()) == 0)
      {
        return true;
      }
    }
   
View Full Code Here

     *
     * @return A sample dataset.
     */
    private static IntervalXYDataset createDataset(List data) throws BadDataForChartException {

        XYSeries series = new XYSeries("Data");
        for (Object obj : data) {
            Map result = (Map)obj;
            if (result.values().size() < 2)
                throw new BadDataForChartException("For chart, must have at least two columns of data");
            Iterator iterator = result.entrySet().iterator();
            Object column1Value = ((Map.Entry)iterator.next()).getValue();
            Object column2Value = ((Map.Entry)iterator.next()).getValue();
            if (!(column1Value instanceof Number) || !(column2Value instanceof Number))
                throw new BadDataForChartException("Data must be decimal or integer.  Can't plot otherwise.");
            series.add((Number)column1Value,
                    (Number)column2Value);
        }

        return new XYSeriesCollection(series);
    }
View Full Code Here

    {
        // Create the chart:
        collection = new XYSeriesCollection();
        XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true,false);

        xySeries = new XYSeries("Automation");
        collection.addSeries(xySeries);

        chart = ChartFactory.createXYLineChart(null,"Time","Value",collection,PlotOrientation.VERTICAL,false,false,false);

        // Customize the chart:
View Full Code Here

     *
     * @return A sample dataset.
     */
    private XYDataset createDataset() {
        XYSeriesCollection data = new XYSeriesCollection();
        XYSeries series1 = createRandomData("Series 1", 75.0, 10.0);
        XYSeries series2 = createRandomData("Series 2", 50.0, 5.0);
        XYSeries series3 = createRandomData("Series 3", 25.0, 1.0);
        data.addSeries(series1);
        data.addSeries(series2);
        data.addSeries(series3);
        return data;
    }
View Full Code Here

     * @param thetaInc  the angle increment.
     *
     * @return The series.
     */
    private static XYSeries createRandomData(String name, double baseRadius, double thetaInc) {
        XYSeries series = new XYSeries(name);
        for (double theta = 0.0; theta < 360.0; theta += thetaInc) {
            double radius = baseRadius * (1.0 + Math.random());
            series.add(theta, radius);
        }
        return series;
    }
View Full Code Here

TOP

Related Classes of org.jfree.data.xy.XYSeries

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.