Package org.jfree.data.statistics

Examples of org.jfree.data.statistics.HistogramDataset


 
  int numberBins;
 
  public HistogramChartModel(ChartTyp type){
    super(type);
    dataset = new HistogramDataset();
  }
View Full Code Here


    super(type);
    dataset = new HistogramDataset();
  }
  public HistogramChartModel(ChartTyp type, String[] vars){
    super(type);
    dataset = new HistogramDataset();
    numberBins=Integer.parseInt(vars[1]);
    categoryVar=new Variable(vars[0]);
  }
View Full Code Here

 
  @Override
  public void fillDataset(QueryResult l) {
   
   
    dataset=new HistogramDataset();
   
    double[] values = new double[l.size()];
    int i=0;
   
    Iterator<Bindings> it = l.getCollection().iterator();
View Full Code Here

    public static JFreeChart buildHistogram(final Number[] numbers, final String dataName, final int divisions) {
        if (numbers == null || numbers.length == 0) {
            return null;
        }

        HistogramDataset dataset = new HistogramDataset();
        dataset.setType(HistogramType.FREQUENCY);
        double[] doubleNumbers = new double[numbers.length];
        for (int i = 0; i < doubleNumbers.length; i++) {
            doubleNumbers[i] = numbers[i].doubleValue();
        }

        dataset.addSeries(dataName, doubleNumbers, divisions > 0 ? divisions : 10);//Use 10 divisions if divisions number is invalid.

        JFreeChart histogram = ChartFactory.createHistogram(
                getMessage("ChartsUtils.report.histogram.title"),
                dataName,
                getMessage("ChartsUtils.report.histogram.yLabel"),
View Full Code Here

        return "Stupid-histogram";
    }

    @Override
    public void runBeforeSimulation(StupidEnvironment env, ParCollection params) {
        dataset = new HistogramDataset();
        dataset.setType(HistogramType.RELATIVE_FREQUENCY);
       
//        chart = ChartFactory.createHistogram(
//                "Test",
//                "LabelX",
View Full Code Here

                max = b.getMyScale();
            }
            i++;
        }
       
        dataset = new HistogramDataset();
        dataset.setType(HistogramType.RELATIVE_FREQUENCY);
        dataset.addSeries("Test", values, max);
       
//        chart = ChartFactory.createHistogram(
//                "Test",
View Full Code Here

   * AbstractEnvironment, eas.startSetup.ParCollection)
   */
  @Override
  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);
View Full Code Here

        try {this.pieFrameList.remove(event.getChartName());} catch (Exception e) {}
    }

    private void addDataToHistogramChart(ChartEvent event, ParCollection params) {
        // Histogram.
        HistogramDataset dataset = this.histogramDataSet.get(event.getChartName());
       
        JFreeChart chart = this.chartList.get(event.getChartName());
       
        if (dataset == null) {
            dataset = new HistogramDataset();
            dataset.setType(event.getHistType());
            dataset.addSeries(
                    event.getSeriesName(),
                    event.getHistogramValues(),
                    event.getHistogramBins(),
                    event.getHistogramMin(),
                    event.getHistogramMax());
           
            chart = ChartFactory.createHistogram(
                    event.getChartName(),
                    event.getxAxisLabel(),
                    event.getyAxisLabel(),
                    dataset,
                    PlotOrientation.VERTICAL,
                    true,
                    true,
                    true);
           
            createFrame(event.getChartName(), event.getChartType(), params, chart);
           
            this.histogramDataSet.put(event.getChartName(), dataset);
            this.chartList.put(event.getChartName(), chart);
        }

        if (!dataset.getType().equals(event.getHistType())) {
            dataset.setType(event.getHistType());
        }

        if (this.containsSeriesHistogram(dataset, event.getSeriesName()) >= 0) {
            /* Change existing series. This is done by awful reflections.
             */
           
            try {
                Field f = dataset.getClass().getDeclaredField("list"); //NoSuchFieldException
                f.setAccessible(true);
                @SuppressWarnings("unchecked")
                List<Map<String, Object>> list = (List<Map<String, Object>>) f.get(dataset);
                List<Map<String, Object>> list2 = new LinkedList<Map<String,Object>>();
                Map<String, Object> removeMap = null;
               
                for (Map<String, Object> map : list) {
                    String key = (String) map.get("key");
                    if (key != null && key.equals(event.getSeriesName())) {
                        removeMap = map;
                    }
                }
               
                list2.addAll(list);
                list2.remove(removeMap);
                this.addSeries(
                        list2,
                        event.getSeriesName(),
                        event.getHistogramValues(),
                        event.getHistogramBins(),
                        event.getHistogramMin(),
                        event.getHistogramMax());
                f.set(dataset, list2);
            } catch (Exception e) {
            } finally {
                dataset.setType(event.getHistType());
            }
        } else {
            // Add new series.
            dataset.addSeries(
                    event.getSeriesName(),
                    event.getHistogramValues(),
                    event.getHistogramBins(),
                    event.getHistogramMin(),
                    event.getHistogramMax());
            dataset.setType(event.getHistType());
        }
    }
View Full Code Here

  }
 
    private void createAllDataset() {
     
      // all values
        this.dataAll = new HistogramDataset();
        double[] values = this.analyze.getAllValues();
        this.dataAll.addSeries("Weights & Thresholds", values, 50);
       
        // weight values
        this.dataThresholds = new HistogramDataset();
        double[] values2 = this.analyze.getWeightValues();
        this.dataThresholds.addSeries("Weights", values2, 50);
       
        // threshold values
        this.dataWeights = new HistogramDataset();
        double[] values3 = this.analyze.getBiasValues();
        this.dataWeights.addSeries("Thresholds", values3, 50);
           
    }
View Full Code Here


  private void initChartPanel(){

    this.display = Display.getCurrent();
    JFreeChart chart = ChartFactory.createHistogram("Histogram", null, null, new HistogramDataset(),
        PlotOrientation.VERTICAL, true, false, false);
    chartPanel = new ChartPanel(chart);

  }
View Full Code Here

TOP

Related Classes of org.jfree.data.statistics.HistogramDataset

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.