Package org.jfree.data.xy

Examples of org.jfree.data.xy.DefaultIntervalXYDataset


    return dataset;
  }

  private XYDataset createIntervalXYDataset()
  {
    final DefaultIntervalXYDataset dataset = new DefaultIntervalXYDataset();
    dataset.addSeries("First",
        new double[][]{{1, 2, 3}, {3, 1, 2}, {1, 2, 1}, {4, 4, 4}, {3, 3, 3}, {4, 4, 4},});// NON-NLS
    // dataset.addSeries("Second", new double[][]{{1, 2, 3}, {3, 0, 1}, {1, 2,
    // 3}, {3, 0, 1}, {1, 2, 3}, {3, 0, 1}, });//NON-NLS
    return dataset;
  }
View Full Code Here


    return dataset;
  }

  private XYDataset createIntervalXYDataset()
  {
    final DefaultIntervalXYDataset dataset = new DefaultIntervalXYDataset();
    dataset.addSeries("First",
        new double[][]{{1, 2, 3}, {3, 1, 2}, {1, 2, 1}, {4, 4, 4}, {3, 3, 3}, {4, 4, 4},});// NON-NLS
    // dataset.addSeries("Second", new double[][]{{1, 2, 3}, {3, 0, 1}, {1, 2,
    // 3}, {3, 0, 1}, {1, 2, 3}, {3, 0, 1}, });//NON-NLS
    return dataset;
  }
View Full Code Here

    double[] endy = new double[algoAggregates.size()];

    XYSeries series1 = new XYSeries("CostBenefit");
    XYSeriesCollection dataset = new XYSeriesCollection();
    dataset.addSeries(series1);
    DefaultIntervalXYDataset datasetxy = new DefaultIntervalXYDataset();
   
    if (connectionModel.getSchema() != null) {
   
      Map<Parameter, Object> algorithmParams = ArgumentUtils.validateParameters(algorithm, algorithmUiExtension.getAlgorithmParameters());
      List<Algorithm.CostBenefit> costBenefit = algorithm.computeAggregateCosts(connectionModel.getSchema(), algorithmParams, algoAggregates);

      double totalbenefit = 0;
      double x = 0;
      int count = 0;
      for (Algorithm.CostBenefit cb : costBenefit) {
        Aggregate agg = algoAggregates.get(count);
        double estimateSpace = agg.estimateSpace();
        double hx = estimateSpace / 2;
        totalLoadTime += cb.getLoadTime();
        totalbenefit += cb.getSavedQueryRowCount();
        series1.add(x + hx, totalbenefit);
       
        xs[count] = x + hx;
        startx[count] = x;
        x += estimateSpace;
        endx[count] = x;
 
        ys[count] = totalbenefit;
        starty[count] = 0;
        endy[count] = 0;
 
        count++;
      }
 
      // update summary table
     
      aggregateSummaryModel.setSelectedAggregateCount(format.format(totalAggregatesSelected));
      aggregateSummaryModel.setSelectedAggregateRows(format.format(totalRows));
      aggregateSummaryModel.setSelectedAggregateSpace(format.format(totalSpace) + " bytes");
      aggregateSummaryModel.setSelectedAggregateLoadTime(format.format(totalLoadTime));
    } else {
      aggregateSummaryModel.setSelectedAggregateCount("");
      aggregateSummaryModel.setSelectedAggregateRows("");
      aggregateSummaryModel.setSelectedAggregateSpace("");
      aggregateSummaryModel.setSelectedAggregateLoadTime("");
     
    }
    // render cost benefit chart
   
    double[][] data = new double[][] {xs, startx, endx, ys, starty, endy};
    datasetxy.addSeries("", data);
   
    JFreeChart chart = ChartFactory.createXYBarChart(
        "", // chart title
        "Cost", // x axis label
        false,
View Full Code Here

    /**
     * Some checks for the getSeriesCount() method.
     */
    public void testGetSeriesCount() {
        DefaultIntervalXYDataset d = new DefaultIntervalXYDataset();
        assertEquals(0, d.getSeriesCount());
        d = createSampleDataset1();
        assertEquals(2, d.getSeriesCount());
    }
View Full Code Here

    /**
     * Some checks for the getSeriesKey(int) method.
     */
    public void testGetSeriesKey() {
        DefaultIntervalXYDataset d = createSampleDataset1();
        assertEquals("S1", d.getSeriesKey(0));
        assertEquals("S2", d.getSeriesKey(1));

        // check for series key out of bounds
        boolean pass = false;
        try {
            /*Comparable k =*/ d.getSeriesKey(-1);
        }
        catch (IllegalArgumentException e) {
            pass = true;
        }
        assertTrue(pass);

        pass = false;
        try {
            /*Comparable k =*/ d.getSeriesKey(2);
        }
        catch (IllegalArgumentException e) {
            pass = true;
        }
        assertTrue(pass);
View Full Code Here

    /**
     * Some checks for the getItemCount() method.
     */
    public void testGetItemCount() {
        DefaultIntervalXYDataset d = createSampleDataset1();
        assertEquals(3, d.getItemCount(0));
        assertEquals(3, d.getItemCount(1));

        // try an index out of bounds
        boolean pass = false;
        try {
            d.getItemCount(2);
        }
        catch (IllegalArgumentException e) {
            pass = true;
        }
        assertTrue(pass);
View Full Code Here

    /**
     * Some checks for the getXValue() method.
     */
    public void testGetXValue() {
        DefaultIntervalXYDataset d = createSampleDataset1();
        assertEquals(1.0, d.getXValue(0, 0), EPSILON);
        assertEquals(2.0, d.getXValue(0, 1), EPSILON);
        assertEquals(3.0, d.getXValue(0, 2), EPSILON);
        assertEquals(11.0, d.getXValue(1, 0), EPSILON);
        assertEquals(12.0, d.getXValue(1, 1), EPSILON);
        assertEquals(13.0, d.getXValue(1, 2), EPSILON);
    }
View Full Code Here

    /**
     * Some checks for the getYValue() method.
     */
    public void testGetYValue() {
        DefaultIntervalXYDataset d = createSampleDataset1();
        assertEquals(4.0, d.getYValue(0, 0), EPSILON);
        assertEquals(5.0, d.getYValue(0, 1), EPSILON);
        assertEquals(6.0, d.getYValue(0, 2), EPSILON);
        assertEquals(14.0, d.getYValue(1, 0), EPSILON);
        assertEquals(15.0, d.getYValue(1, 1), EPSILON);
        assertEquals(16.0, d.getYValue(1, 2), EPSILON);
    }
View Full Code Here

    /**
     * Some checks for the getStartXValue() method.
     */
    public void testGetStartXValue() {
        DefaultIntervalXYDataset d = createSampleDataset1();
        assertEquals(0.9, d.getStartXValue(0, 0), EPSILON);
        assertEquals(1.9, d.getStartXValue(0, 1), EPSILON);
        assertEquals(2.9, d.getStartXValue(0, 2), EPSILON);
        assertEquals(10.9, d.getStartXValue(1, 0), EPSILON);
        assertEquals(11.9, d.getStartXValue(1, 1), EPSILON);
        assertEquals(12.9, d.getStartXValue(1, 2), EPSILON);
    }
View Full Code Here

    /**
     * Some checks for the getEndXValue() method.
     */
    public void testGetEndXValue() {
        DefaultIntervalXYDataset d = createSampleDataset1();
        assertEquals(1.1, d.getEndXValue(0, 0), EPSILON);
        assertEquals(2.1, d.getEndXValue(0, 1), EPSILON);
        assertEquals(3.1, d.getEndXValue(0, 2), EPSILON);
        assertEquals(11.1, d.getEndXValue(1, 0), EPSILON);
        assertEquals(12.1, d.getEndXValue(1, 1), EPSILON);
        assertEquals(13.1, d.getEndXValue(1, 2), EPSILON);
    }
View Full Code Here

TOP

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

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.