Package org.jfree.data.xy

Examples of org.jfree.data.xy.DefaultTableXYDataset


        // Chart type
        //
        String chartType = ServletRequestUtils.getStringParameter(request, "ct", "area");


        DefaultTableXYDataset ds = new DefaultTableXYDataset();

        if (provider != null) {
            Object o = getApplicationContext().getBean(provider);
            if (o instanceof SeriesProvider) {
                ((SeriesProvider) o).populate(ds, statsCollection, request);
View Full Code Here


        return vl;
    }

    private static Component getLevelChart() {

        DefaultTableXYDataset ds = new DefaultTableXYDataset();
        NumberAxis y = new NumberAxis("Y");

        XYSeries series;

        series = new XYSeries("BAR", false, false);
        series.add(0, 0);
        series.add(1, 56);
        series.add(2, 54);
        series.add(3, 40);
        series.add(4, 12);
        series.add(5, 5);
        series.add(6, 2);
        ds.addSeries(series);

        series = new XYSeries("FOO", false, false);
        series.add(0, 0);
        series.add(1, 66);
        series.add(2, 64);
        series.add(3, 50);
        series.add(4, 22);
        series.add(5, 15);
        series.add(6, 10);
        ds.addSeries(series);

        series = new XYSeries("SDF", false, false);
        series.add(0, 0);
        series.add(1, 76);
        series.add(2, 74);
        series.add(3, 60);
        series.add(4, 32);
        series.add(5, 25);
        series.add(6, 20);
        ds.addSeries(series);

        // Paint p = new Color(0, 0, 0, Color.OPAQUE);
        // r.setSeriesPaint(0, p);
        // BasicStroke s = new BasicStroke(2);
        // r.setSeriesStroke(0, s);

        DefaultTableXYDataset ds2 = new DefaultTableXYDataset();
        series = new XYSeries("DOO", false, false);
        series.add(1, 60);
        series.add(2, 64);
        series.add(3, 54);
        series.add(4, 30);
        series.add(5, 25);
        series.add(6, 15);
        ds2.addSeries(series);

        XYAreaRenderer r = new XYAreaRenderer(XYAreaRenderer.AREA_AND_SHAPES);

        XYPlot plot2 = new XYPlot(ds2, new NumberAxis("X"), y,
                new XYLineAndShapeRenderer());
View Full Code Here

        return new JFreeChartWrapper(c);
    }

    private static Component regressionChart() {

        DefaultTableXYDataset ds = new DefaultTableXYDataset();

        XYSeries series;

        series = new XYSeries("BAR", false, false);
        series.add(1, 1);
        series.add(2, 4);
        series.add(3, 6);
        series.add(4, 9);
        series.add(5, 9);
        series.add(6, 11);
        ds.addSeries(series);

        JFreeChart scatterPlot = ChartFactory.createScatterPlot("Regression",
                "X", "Y", ds, PlotOrientation.HORIZONTAL, true, false, false);

        XYPlot plot = (XYPlot) scatterPlot.getPlot();
View Full Code Here

         XYSeries set = new XYSeries(attribute, false, false);
         for (int i = 0; i < data.size(); i++)
         {
            set.add(new Integer(i), (Number)data.get(i));
         }
         DefaultTableXYDataset dataset = new DefaultTableXYDataset(false);
         dataset.addSeries(set);
         JFreeChart chart = ChartFactory.createXYLineChart(
                 "JMX Attribute: " + attribute, "count", attribute, dataset,
                 PlotOrientation.VERTICAL,
                 true,
                 true,
View Full Code Here

 


  public static JFreeChart createChartReal(Matrix matrix, boolean sin, String titlePart1, String titlePart2)
  {
    DefaultTableXYDataset dataset = calculateChartDatasetRealraum(matrix, sin);
   
    JFreeChart chart = ChartFactory.createXYLineChart(
        titlePart1 + ", time domain " + (sin ? "(sin)":"(cos)") + ", " + titlePart2, // title
        "time t", // x-axis label
        "amplitude f(t)", // y-axis label
View Full Code Here

 
  }

  public static JFreeChart createChartMaxAmp(Matrix matrix, String titlePart1, String titlePart2)
  {
    DefaultTableXYDataset dataset = calculateChartDatasetMaxAmp(matrix);
    JFreeChart chart = ChartFactory.createXYLineChart(
        titlePart1 + ", time domain (norm), " + titlePart2, // title
        "time t", // x-axis label
        "amplitude f(t)", // y-axis label
        dataset, // data
View Full Code Here

      sb.append(" (near), ");
    else
      sb.append(" (far), ");
    sb.append(titlePart2);
   
    DefaultTableXYDataset dataSet = calculateChartDatasetSpektrum(matrix, nah, onlyAll);
    JFreeChart chart = ChartFactory.createXYLineChart(
        sb.toString(), // title
        "frequency f (normalized)", // x-axis label
        "power spectrum (dB)", // y-axis label
        dataSet, // data
View Full Code Here

      }
      if (power > maxPower)
        maxPower = power;
    }
 
    DefaultTableXYDataset xyData = new DefaultTableXYDataset();
   
    if (!onlyAll){
      for (int basisVector = 0; basisVector < matrix.getRowDimension(); basisVector++) {
 
        XYSeries xySeries = new XYSeries("Func " + basisVector, true, false);
 
        for (int i = -stepsToOneSide; i < stepsToOneSide; i++) {
          double time2 = i / (double)stepspertab;
          double time = time2 * StrictMath.PI;
 
          double sum = 0;
          for (int carrier = 0; carrier < carriers; carrier++) {
            double ck = matrix.get(basisVector, carrier);
            double timesinc = time + (-carrier + translation) * StrictMath.PI;
            double sinc = sinc(timesinc);
            double value = ck * sinc;
            sum += value;
          }
          double power = sum*sum;
          xySeries.add(time2, Math.max(minDezibel, 10*Math.log10(power/maxPower)));
        }
        xyData.addSeries(xySeries);
      }
    }
 
    XYSeries xySeriesSum = new XYSeries("Sum ", true, false);
    for (int i = -stepsToOneSide; i < stepsToOneSide; i++) {
      double time2 = i / (double)stepspertab;
      double time = time2 * StrictMath.PI;
      double power = 0;
      for (int basisVector = 0; basisVector < matrix.getRowDimension(); basisVector++) {
        double sum = 0;
        for (int carrier = 0; carrier < carriers; carrier++) {
          double ck = matrix.get(basisVector, carrier);
          double timesinc = time + (-carrier + translation) * StrictMath.PI;
          double sinc = sinc(timesinc);
          double value = ck * sinc;
          sum += value;
        }
        power += sum*sum;
      }
      xySeriesSum.add(time2, Math.max(minDezibel, 10*Math.log10(power/maxPower)));
    }
    xyData.addSeries(xySeriesSum);
 
    return xyData;
  }
View Full Code Here

  private static DefaultTableXYDataset calculateChartDatasetMaxAmp(Matrix matrix) {
    int n = matrix.getColumnDimension();
    double translate = (n - 1) / 2d;
    int steps = 200;
   
    DefaultTableXYDataset xyData = new DefaultTableXYDataset();
    for (int basisVector = 0; basisVector < matrix.getRowDimension(); basisVector++) {
 
      XYSeries xySeries1 = new XYSeries("Ampl. " + basisVector, true, false);
 
      for (int i = -steps; i <= steps; i++)
      {
        double omega = i * StrictMath.PI / steps;
 
        double sumCos = 0;
        double sumSin = 0;
       
        for (int carrier = 0; carrier < n; carrier++) {
          double ck = matrix.get(basisVector, carrier);
                             
          sumSin += ck * StrictMath.sin((carrier-translate) * omega);           
          sumCos += ck * StrictMath.cos((carrier-translate) * omega)
        }
       
       
        xySeries1.add(omega, StrictMath.sqrt(sumSin*sumSin+ sumCos*sumCos));
      }
      xyData.addSeries(xySeries1);
    }
    return xyData;
  }
View Full Code Here

  private static DefaultTableXYDataset calculateChartDatasetRealraum(Matrix matrix, boolean sin) {
    int n = matrix.getColumnDimension();
    double translate = (n - 1) / 2d;
    int steps = 200;
   
    DefaultTableXYDataset xyData = new DefaultTableXYDataset();
    for (int basisVector = 0; basisVector < matrix.getRowDimension(); basisVector++) {
 
      XYSeries xySeries1 = new XYSeries("Ampl. " + basisVector, true, false);
 
      for (int i = -steps; i <= steps; i++)
      {
        double omega = i * StrictMath.PI / steps;
 
        double sum = 0;
       
        for (int carrier = 0; carrier < n; carrier++) {
          double ck = matrix.get(basisVector, carrier);
                             
          if (sin)
            sum += ck * StrictMath.sin((carrier-translate) * omega);           
          else
            sum += ck * StrictMath.cos((carrier-translate) * omega)
        }
       
       
        xySeries1.add(omega, sum);
      }
      xyData.addSeries(xySeries1);
    }
    return xyData;
  }
View Full Code Here

TOP

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

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.