Package org.jfree.data.general

Examples of org.jfree.data.general.DefaultPieDataset


    }
    chartRemote.setDataSource(dataSource);
    Collection chartRawData = (Collection)chartRemote.getTicketPieData(individualId, listParameters);

    // Add the raw data to a JFree dataset
    DefaultPieDataset pieData = new DefaultPieDataset();

    int totalTickets = 0;
    Iterator iter = chartRawData.iterator();
    while (iter.hasNext())
    {
      HashMap row = (HashMap)iter.next();
      String userName = (String)row.get("name");
      Number openTickets = (Number)row.get("count");
      if(userName == null){
    userName = "UnAssigned";
    }
      totalTickets += openTickets.intValue();
      pieData.setValue(userName, openTickets);
    }

    // create the chart
    JFreeChart pieChart = ChartFactory.createPieChart("Open Tickets by User", pieData, true, true, false);
View Full Code Here


    }
    chartRemote.setDataSource(dataSource);
    Collection chartRawData = (Collection)chartRemote.getOpportunityPieData(individualId, listParameters);

    // Add the raw data to a JFree dataset
    DefaultPieDataset pieData = new DefaultPieDataset();
    float totalForecast = 0.00f;
    float totalActual = 0.00f;
    Iterator iter = chartRawData.iterator();
    while (iter.hasNext())
    {
      HashMap row = (HashMap)iter.next();
      String stageName = (String)row.get("stageName");
      Number count = (Number)row.get("count");
      Number forecastAmount = (Number)row.get("forecastAmount");
      Number actualAmount = (Number)row.get("actualAmount");

      totalForecast += forecastAmount.floatValue();
      totalActual += actualAmount.floatValue();

      pieData.setValue(stageName + " (" + count.toString() + ")", forecastAmount);
    }

    // format the totals as US Currency
    NumberFormat numFormatter = NumberFormat.getCurrencyInstance();
    String totalForecastString = numFormatter.format(totalForecast);
View Full Code Here

    return xyzDataset;
  }

  private PieDataset createPieDataset()
  {
    final DefaultPieDataset dataset = new DefaultPieDataset();
    dataset.setValue("Part 1", 23);// NON-NLS
    dataset.setValue("Part 2", 35);// NON-NLS
    dataset.setValue("Part 3", 42);// NON-NLS
    return dataset;
  }
View Full Code Here

   *
   * @return A sample dataset.
   */
  private PieDataset createSampleDataset(final int[] votes)
  {
    final DefaultPieDataset result = new DefaultPieDataset();
    // cheating: java has a higher chance to be the best language :)
    result.setValue("Java", new Integer(votes[0]));
    result.setValue("Visual Basic", new Integer(votes[1]));
    result.setValue("C/C++", new Integer(votes[2]));
    result.setValue("PHP", new Integer(votes[3]));
    result.setValue("Perl", new Integer(votes[4]));
    return result;
  }
View Full Code Here

   *
   * @return A sample dataset.
   */
  private PieDataset createSampleDataset()
  {
    final DefaultPieDataset result = new DefaultPieDataset();
    // cheating: java has a higher chance to be the best language :)
    result.setValue("Java", new Integer((int) (Math.random() * 200)));
    result.setValue("Visual Basic", new Integer((int) (Math.random() * 50)));
    result.setValue("C/C++", new Integer((int) (Math.random() * 100)));
    result.setValue("PHP", new Integer((int) (Math.random() * 50)));
    result.setValue("Perl", new Integer((int) (Math.random() * 100)));
    return result;

  }
View Full Code Here

   *
   * @return A sample dataset.
   */
  private PieDataset createSampleDataset()
  {
    final DefaultPieDataset result = new DefaultPieDataset();
    // cheating: java has a higher chance to be the best language :)
    result.setValue("Java", new Integer((int) (Math.random() * 200)));
    result.setValue("Visual Basic", new Integer((int) (Math.random() * 50)));
    result.setValue("C/C++", new Integer((int) (Math.random() * 100)));
    result.setValue("PHP", new Integer((int) (Math.random() * 50)));
    result.setValue("Perl", new Integer((int) (Math.random() * 100)));
    return result;

  }
View Full Code Here

   * @return A sample dataset.
   */
  private PieDataset createSampleDataset()
  {

    final DefaultPieDataset result = new DefaultPieDataset();
    result.setValue("Java", new Double(43.2));
    result.setValue("Visual Basic", new Double(10.0));
    result.setValue("C/C++", new Double(17.5));
    result.setValue("PHP", new Double(32.5));
    result.setValue("Perl", new Double(0.0));
    return result;

  }
View Full Code Here

   * @return A sample dataset.
   */
  private PieDataset createSampleDataset()
  {

    final DefaultPieDataset result = new DefaultPieDataset();
    result.setValue("Java", new Double(43.2));
    result.setValue("Visual Basic", new Double(10.0));
    result.setValue("C/C++", new Double(17.5));
    result.setValue("PHP", new Double(32.5));
    result.setValue("Perl", new Double(0.0));
    return result;

  }
View Full Code Here

   *
   * @return A sample dataset.
   */
  private PieDataset createSampleDataset()
  {
    final DefaultPieDataset result = new DefaultPieDataset();
    // cheating: java has a higher chance to be the best language :)
    result.setValue("Java", new Integer((int) (Math.random() * 200)));
    result.setValue("Visual Basic", new Integer((int) (Math.random() * 50)));
    result.setValue("C/C++", new Integer((int) (Math.random() * 100)));
    result.setValue("PHP", new Integer((int) (Math.random() * 50)));
    result.setValue("Perl", new Integer((int) (Math.random() * 100)));
    return result;

  }
View Full Code Here

    this.valueColumn = valueColumn;
  }

  protected Dataset createNewDataset()
  {
    return new DefaultPieDataset();
  }
View Full Code Here

TOP

Related Classes of org.jfree.data.general.DefaultPieDataset

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.