Package org.jfree.data.xy

Examples of org.jfree.data.xy.XYSeries


            continue;

         return false;
      }

      XYSeries serCur = _fillInVariableMarker(strId);
      super.addSeries(serCur);
      return true;
   }
View Full Code Here


         XYSeriesCollection serCollection = (XYSeriesCollection) dst;

         for (int intSer = 0; intSer < serCollection.getSeriesCount(); intSer++)
         {
            XYSeries ser = serCollection.getSeries(intSer);
            String keyCur = (String) ser.getKey();

            if(keyCur.compareTo(strOldValue) != 0)
               continue;

            ser.setKey(strNewValue);    
            //System.out.println(ser.getKey());
            break;
         }
      }
   }
View Full Code Here

      // 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

     * 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

     *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

     * Draws and Returns the Soil Pressure Chart
     * @return
     *  Soil Pressure Chart
     */
    private JFreeChart drawPressureChart(){
        XYSeries series1 = new XYSeries("Soil Pressure");
        int numOfElements = r.getNumOfNodes();
        for(int i=0;i<numOfElements;i++){
                series1.add(-r.getDepth(i), r.getSoilPressure(i));
            }
            XYSeriesCollection dataset = new XYSeriesCollection(series1);
            JFreeChart chart = ChartFactory.createXYLineChart("Soil Pressure", "Depth (m)", "Soil Pressure (kPa)", 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

     * Draws and returns the Limit Pressure Chart
     * @return
     *  Limit Pressure Chart
     */
    private JFreeChart drawLimitPressureChart(){
        XYSeries series1 = new XYSeries("ABS Limit Pressure");
        int numOfElements = r.getNumOfNodes();
        for(int i=0;i<numOfElements;i++){
                series1.add(-r.getDepth(i), r.getLimitPressure(i));
            }
            XYSeriesCollection dataset = new XYSeriesCollection(series1);
            JFreeChart chart = ChartFactory.createXYLineChart("ABS Limit Pressure", "Depth (m)", "ABS Limit Pressure (kPa)", 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

    /**
     * Draws and returns the Rotation Chart
     * @return
     */
    private JFreeChart drawRotationChart(){
        XYSeries series1 = new XYSeries("Rotation");
        int numOfElements = r.getNumOfNodes();
        for(int i=0;i<numOfElements;i++){
                series1.add(-r.getDepth(i), r.getRotation(i));
            }
            XYSeriesCollection dataset = new XYSeriesCollection(series1);
            JFreeChart chart = ChartFactory.createXYLineChart("Rotation", "Depth (m)", "Rotation (rad)", 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

    /**
     * Draws and returns the Bending Moment Chart
     * @return
     */
    private JFreeChart drawBendingMomentChart(){
        XYSeries series1 = new XYSeries("Bending Moment");
        int numOfElements = r.getNumOfNodes();
        for(int i=0;i<numOfElements;i++){
                series1.add(-r.getDepth(i), r.getBendingMoment(i));
            }
            XYSeriesCollection dataset = new XYSeriesCollection(series1);
            JFreeChart chart = ChartFactory.createXYLineChart("Bending Moment", "Depth (m)", "Bending Moment (kNm)", 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

     * Draws and returns the Shear Force Chart
     * @return
     *  Shear Force Chart
     */
    private JFreeChart drawShearForceChart(){
        XYSeries series1 = new XYSeries("Shear Force");
        int numOfElements = r.getNumOfNodes();
        for(int i=0;i<numOfElements;i++){
                series1.add(-r.getDepth(i), r.getShearForce(i));
            }
            XYSeriesCollection dataset = new XYSeriesCollection(series1);
            JFreeChart chart = ChartFactory.createXYLineChart("Shear Force", "Depth (m)", "Shear Force (kN)", 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

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

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.