Package org.jfree.data.category

Examples of org.jfree.data.category.DefaultCategoryDataset


    }

    @Override
    public void runBeforeSimulation(StandardCleaningEnvironment env,
            ParCollection params) {
        dataset = new DefaultCategoryDataset();       
//        chart = ChartFactory.createLineChart(
//                "Dirt count",
//                "Simulation time",
//                "Avg. amount of dirt on every grid field",
//                dataset,
View Full Code Here


  public void runBeforeSimulation(StupidEnvironment env, ParCollection params) {

    dataset = new HistogramDataset();
//    diagramWindow = new StaticWindow("Bug-Counter", 350, 350, true);
   
    DefaultCategoryDataset data = new DefaultCategoryDataset();
   
    JFreeChart cs = ChartFactory.createLineChart("Titel", "Label 1", "label 2", data, PlotOrientation.HORIZONTAL, false, false, false);

//    final JFreeChart chart = ChartFactory.createHistogram(
//        "Stupidity of Agents", // chart title
View Full Code Here

        return "Stupid-Bug-Counter-Plugin";
    }

    @Override
    public void runBeforeSimulation(StupidEnvironment env, ParCollection params) {
        dataset = new DefaultCategoryDataset();       
//        chart = ChartFactory.createLineChart(
//                "Bug count",
//                "Simulation time",
//                "Number of agents",
//                dataset,
View Full Code Here

        return chart;
    }
    public static JFreeChart generateBarChart() {
        DefaultCategoryDataset dataSet = new DefaultCategoryDataset();
        dataSet.setValue(791, "Population", "1750 AD");
        dataSet.setValue(978, "Population", "1800 AD");
        dataSet.setValue(1262, "Population", "1850 AD");
        dataSet.setValue(1650, "Population", "1900 AD");
        dataSet.setValue(2519, "Population", "1950 AD");
        dataSet.setValue(6070, "Population", "2000 AD");
        JFreeChart chart = ChartFactory.createBarChart(
                "World Population growth", "Year", "Population in millions",
                dataSet, PlotOrientation.VERTICAL, false, true, false);
View Full Code Here

    return chart;
  }   

  private CategoryDataset createCategoryDataset(ChartValue[] values)
  {
    DefaultCategoryDataset dataset = new DefaultCategoryDataset();

    for (int i = 0; i < values.length; i++)
    {
      CategoryChartValue value = (CategoryChartValue) values[i];
      dataset.addValue(value.getValue(), value.getSeries(), value.getCategory());
    }

    return dataset;
  }
View Full Code Here

      CompareElementsEditor sourcepart, Composite parent,
      boolean showGoalRatings, boolean weighted) {

    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new FillLayout());
    final DefaultCategoryDataset dataset = createSpiderDataset(
        sourcepart.getElements(), sourcepart.getAccessLayer(),
        sourcepart.getCacheManager(), showGoalRatings, weighted);
    JFreeChart chart = createSpiderChart(dataset, weighted);
    ChartComposite chartComposite = new ChartComposite(composite, SWT.NONE,
        chart, true);
View Full Code Here

   * @return the created Dataset
   */
  private DefaultCategoryDataset createSpiderDataset(List<Element> elements,
      AccessLayer accessLayer, CacheManager cacheManager,
      boolean showGoalRating, boolean weighted) {
    DefaultCategoryDataset categoryDataset = new DefaultCategoryDataset();
    for (Element element : elements) {
      List<Element> leafElements = null;
      if (showGoalRating == true)
        leafElements = cacheManager
            .getLeafApplicableElementElements(GSSLayer.layer1);
      else
        leafElements = cacheManager
            .getLeafApplicableElementElements(GSSLayer.layer3);
      for (Element leafElement : leafElements) {
        if (leafElement.getClass() == element.getClass())
          continue; // skip case principle <-> principle
        Float ratingValue = cacheManager.getIndirectRatingWeight(
            (ConstrainedElement) element, leafElement);
        if (ratingValue == null) {
          ratingValue = 0.0f;
        }

        if (weighted) {
          Float weight = 0.0f;
          if (leafElement instanceof Principle)
            weight = cacheManager
                .getSelectedPrinciplePriority((Principle) leafElement);
          if (leafElement instanceof Goal)
            weight = cacheManager
                .getSelectedGoalPriority((Goal) leafElement);
          if (weight == null)
            weight = 0.0f;
          ratingValue = (ratingValue * weight / 100.0f) + 100;
        } else {
          ratingValue += 100.0f;
        }

        categoryDataset.addValue(ratingValue,
            accessLayer.getAttributeValue(element, "name"),
            accessLayer.getAttributeValue(leafElement, "name"));

      }
    }
View Full Code Here

        comment = "Amount of unsatisfied clauses \n";
       // datasetT = new DefaultCategoryDataset();
        //datasetR = new DefaultCategoryDataset();
        //datasetU = new DefaultCategoryDataset();
        //Pat
        dataset =new DefaultCategoryDataset();
        this.title = title;
        this.x = x;
        this.y = y;
  }
View Full Code Here

    case VBAR:
    case HBAR:
    case LINE:
    case SPIDER: {
      // 设置填充的数据集
      DefaultCategoryDataset dataset = new DefaultCategoryDataset();

      int step = 1 + (itemNames == null ? 1 : 0)
          + (groupNames != null && groupNames[0].length() == 0 ? 1 : 0);
      for (int i = 0; i < size; i++) {
        String name;
        if (itemNames != null) {
          name = itemNames[groupNames != null && groupNames[0].length() > 0 ? (i / step)
              / groupNames.length
              : i * itemNames.length / size];
        } else {
          name = data[i].toString();
          i++;
        }
        String category;
        if (groupNames != null) {
          if (groupNames[0].length() == 0) {
            category = data[i].toString();
            i++;
          } else {
            category = groupNames[((i / step) % groupNames.length)];
          }
        } else {
          category = "";
        }
        dataset
            .addValue(Double.parseDouble(data[i].toString()), category, name);
      }

      if (type == SPIDER) {
        AdvancedSpiderWebPlot plot = new AdvancedSpiderWebPlot(dataset);
View Full Code Here

        return chart;
    }

    private SpiderWebPlot valorizzaDataset(Dataset dataset) {

        DefaultCategoryDataset defaultcategorydataset = (DefaultCategoryDataset) dataset;

        SpiderWebPlot spiderwebplot = new SpiderWebPlot(defaultcategorydataset);
        spiderwebplot.setInteriorGap(0.40000000000000002D);
        return spiderwebplot;
    }
View Full Code Here

TOP

Related Classes of org.jfree.data.category.DefaultCategoryDataset

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.