Package org.jfree.data.xy

Examples of org.jfree.data.xy.XYSeriesCollection


            }
        }

        //Distribution series
        XYSeries dSeries = ChartUtils.createXYSeries(dist, "Clustering Coefficient");
        XYSeriesCollection dataset = new XYSeriesCollection();
        dataset.addSeries(dSeries);

        JFreeChart chart = ChartFactory.createScatterPlot(
                "Clustering Coefficient Distribution",
                "Value",
                "Count",
View Full Code Here


    }

    public String getReport() {
        //Distribution series
        XYSeries dSeries = ChartUtils.createXYSeries(degreeDist, "Degree Distribution");
        XYSeriesCollection dataset = new XYSeriesCollection();
        dataset.addSeries(dSeries);

        JFreeChart chart = ChartFactory.createXYLineChart(
                "Degree Distribution",
                "Value",
                "Count",
View Full Code Here

        //Distribution series
        XYSeries dSeries = ChartUtils.createXYSeries(degreeDist, "Degree Distribution");
        XYSeries idSeries = ChartUtils.createXYSeries(inDegreeDist, "In-Degree Distribution");
        XYSeries odSeries = ChartUtils.createXYSeries(outDegreeDist, "Out-Degree Distribution");

        XYSeriesCollection dataset1 = new XYSeriesCollection();
        dataset1.addSeries(dSeries);

        XYSeriesCollection dataset2 = new XYSeriesCollection();
        dataset2.addSeries(idSeries);

        XYSeriesCollection dataset3 = new XYSeriesCollection();
        dataset3.addSeries(odSeries);

        JFreeChart chart1 = ChartFactory.createXYLineChart(
                "Degree Distribution",
                "Value",
                "Count",
View Full Code Here

        XYSeries dHubsSeries = ChartUtils.createXYSeries(distHubs, "Hubs");

        //Distribution of authority series
        XYSeries dAuthsSeries = ChartUtils.createXYSeries(distAuthorities, "Authority");

        XYSeriesCollection datasetHubs = new XYSeriesCollection();
        datasetHubs.addSeries(dHubsSeries);

        XYSeriesCollection datasetAuths = new XYSeriesCollection();
        datasetAuths.addSeries(dAuthsSeries);

        JFreeChart chart = ChartFactory.createXYLineChart(
                "Hubs Distribution",
                "Score",
                "Count",
View Full Code Here

        }

        //Distribution series
        XYSeries dSeries = ChartUtils.createXYSeries(dist, "PageRanks");

        XYSeriesCollection dataset = new XYSeriesCollection();
        dataset.addSeries(dSeries);

        JFreeChart chart = ChartFactory.createXYLineChart(
                "PageRank Distribution",
                "Score",
                "Count",
View Full Code Here

        }

        //Distribution series
        XYSeries dSeries = ChartUtils.createXYSeries(dist, "Eigenvector Centralities");

        XYSeriesCollection dataset = new XYSeriesCollection();
        dataset.addSeries(dSeries);

        JFreeChart chart = ChartFactory.createScatterPlot(
                "Eigenvector Centrality Distribution",
                "Score",
                "Count",
View Full Code Here

  /**
   * Builds and returns JFreeChart.
   * @return
   */
  public JFreeChart build(){
    XYSeriesCollection collection = new XYSeriesCollection();
    for(XYSeries s : seriesMap.values()){
      collection.addSeries(s);
    }
    JFreeChart chart = ChartFactory.createXYLineChart(chartName, xDomain, yDomain, collection, PlotOrientation.VERTICAL, true, true, false);
    XYPlot plot = chart.getXYPlot();
    plot.setBackgroundPaint(Color.WHITE);
    plot.setDomainGridlinePaint(Color.LIGHT_GRAY);
    plot.setRangeGridlinePaint(Color.LIGHT_GRAY);
    NumberAxis yAxis = (NumberAxis) plot.getRangeAxis();
    Range rangeBounds = collection.getRangeBounds(true);
    double upper = Math.min(rangeBounds.getUpperBound(), rangeBounds.getLowerBound()*5);
    if(upper == 0.0){ upper = 10000; }
    if(rangeBounds.getLowerBound() == upper){
      yAxis.setRangeWithMargins(rangeBounds.getLowerBound()-rangeBounds.getLowerBound()*.1,upper+upper*.1);
    }
 
View Full Code Here

    }
  }
 
  private void plot(VehicleRoutingProblem vrp, final Collection<VehicleRoute> routes, String pngFile, String title){
    log.info("plot to " + pngFile);
    XYSeriesCollection problem = null;
    XYSeriesCollection solution = null;
    final XYSeriesCollection shipments;
    try {
      retrieveActivities(vrp);
      problem = new XYSeriesCollection(activities);
      shipments = makeShipmentSeries(vrp.getJobs().values());
      if(routes!=null) solution = makeSolutionSeries(vrp, routes);
    } catch (NoLocationFoundException e) {
      log.warn("cannot plot vrp, since coord is missing");
      return
View Full Code Here

    }
  }

  private XYSeriesCollection makeSolutionSeries(VehicleRoutingProblem vrp, Collection<VehicleRoute> routes) throws NoLocationFoundException{
    Locations locations = retrieveLocations(vrp);
    XYSeriesCollection coll = new XYSeriesCollection();
    int counter = 1;
    for(VehicleRoute route : routes){
      if(route.isEmpty()) continue;
      XYSeries series = new XYSeries(counter, false, true);
     
      Coordinate startCoord = locations.getCoord(route.getStart().getLocationId());
      series.add(startCoord.getX()*scalingFactor, startCoord.getY()*scalingFactor);
     
      for(TourActivity act : route.getTourActivities().getActivities()){
        Coordinate coord = locations.getCoord(act.getLocationId());
        series.add(coord.getX()*scalingFactor, coord.getY()*scalingFactor);
      }
     
      Coordinate endCoord = locations.getCoord(route.getEnd().getLocationId());
      series.add(endCoord.getX()*scalingFactor, endCoord.getY()*scalingFactor);
     
      coll.addSeries(series);
      counter++;
    }
    return coll;
  }
View Full Code Here

    }
    return coll;
  }
 
  private XYSeriesCollection makeShipmentSeries(Collection<Job> jobs) throws NoLocationFoundException{
    XYSeriesCollection coll = new XYSeriesCollection();
    if(!plotShipments) return coll;
    int sCounter = 1;
    String ship = "shipment";
    boolean first = true;
    for(Job job : jobs){
      if(!(job instanceof Shipment)){
        continue;
      }
      Shipment shipment = (Shipment)job;
      XYSeries shipmentSeries;
      if(first){
        first = false;
        shipmentSeries = new XYSeries(ship, false, true);
      }
      else{
        shipmentSeries = new XYSeries(sCounter, false, true);
        sCounter++;
      }
      shipmentSeries.add(shipment.getPickupCoord().getX()*scalingFactor, shipment.getPickupCoord().getY()*scalingFactor);
      shipmentSeries.add(shipment.getDeliveryCoord().getX()*scalingFactor, shipment.getDeliveryCoord().getY()*scalingFactor);
      coll.addSeries(shipmentSeries);
    }
    return coll;
  }
View Full Code Here

TOP

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

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.