Examples of XYSeries


Examples of org.jfree.data.xy.XYSeries

      // Or.... choose between a line graph and a bar graph depending upon
      // whether the type of the domain is numeric.

      XYSeriesCollection data = new XYSeriesCollection();

      XYSeries series = new XYSeries(domainVariable);

      for (Iterator it = trials.iterator(); it.hasNext();) {
        Trial trial = (Trial) it.next();
        if (trial.getException() != null) {
          continue;
        }
        double time = trial.getRunTimeMillis();
        String domainValue = (String) trial.getVariables().get(domainVariable);
        series.add(Double.parseDouble(domainValue), time);
      }

      data.addSeries(series);

      JFreeChart chart = ChartFactory.createXYLineChart(title, domainVariable,
          valueTitle, data, PlotOrientation.VERTICAL, false, false, false);
      XYPlot plot = chart.getXYPlot();
      plot.getRangeAxis().setUpperBound(maxTime + maxTime * 0.1);
      double maxDomainValue = getMaxValue(comparativeResults, domainVariable);
      plot.getDomainAxis().setUpperBound(maxDomainValue + maxDomainValue * 0.1);
      return chart;
    } else if (numVariables == 2) {
      // Show a line graph with two series
      XYSeriesCollection data = new XYSeriesCollection();

      Set seriesValues = (Set) variableValues.get(seriesVariable);

      for (Iterator it = seriesValues.iterator(); it.hasNext();) {
        String seriesValue = (String) it.next();
        XYSeries series = new XYSeries(seriesValue);

        for (Iterator trialsIt = trials.iterator(); trialsIt.hasNext();) {
          Trial trial = (Trial) trialsIt.next();
          if (trial.getException() != null) {
            continue;
          }
          Map variables = trial.getVariables();
          if (variables.get(seriesVariable).equals(seriesValue)) {
            double time = trial.getRunTimeMillis();
            String domainValue = (String) trial.getVariables().get(
                domainVariable);
            series.add(Double.parseDouble(domainValue), time);
          }
        }
        data.addSeries(series);
      }
      // TODO(tobyr) - Handle graphs above 2 variables
View Full Code Here

Examples of org.jfree.data.xy.XYSeries

     * Draws and returns the Soil Displacement Chart
     * @return
     *  Soil Displacement Chart
     */
    private JFreeChart drawDispChart(){
        XYSeries series1 = new XYSeries("Pile Displacement");
        int numOfElements = r.getNumOfNodes();
        for(int i=0;i<numOfElements;i++){
                series1.add(-r.getDepth(i), r.getDisplacement(i)*1000);
            }
            XYSeriesCollection dataset = new XYSeriesCollection(series1);
            JFreeChart chart = ChartFactory.createXYLineChart("Pile Displacement", "Depth (m)", "Displacement (mm)", dataset, PlotOrientation.HORIZONTAL, true, true, false);
           
            XYPlot plot = (XYPlot) chart.getPlot();
View Full Code Here

Examples of org.jfree.data.xy.XYSeries

     *Draws and returns the Soil Movement Chart
     * @return
     *  Soil Movement Chart
     */
    private JFreeChart drawMovementChart(){
        XYSeries series1 = new XYSeries("Soil Movement");
        int numOfElements = r.getNumOfNodes();
        for(int i=0;i<numOfElements;i++){
                series1.add(-r.getDepth(i), r.getSoilMovement(i)*1000);
            }
            XYSeriesCollection dataset = new XYSeriesCollection(series1);
            JFreeChart chart = ChartFactory.createXYLineChart("Soil Movement", "Depth (m)", "Soil Movement (mm)", dataset, PlotOrientation.HORIZONTAL, true, true, false);
            XYPlot plot = (XYPlot) chart.getPlot();
            plot.setAxisOffset(new RectangleInsets(2.0, 2.0, 2.0, 2.0));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.