Package org.jfree.data.general

Examples of org.jfree.data.general.DefaultPieDataset


        return ac.calculateColumnValuesFrequencies(table, column);
    }

    public JFreeChart buildPieChart(final Map<Object, Integer> valuesFrequencies) {
        final ArrayList<Object> values= new ArrayList<Object>(valuesFrequencies.keySet());
        DefaultPieDataset pieDataset = new DefaultPieDataset();

        for (Object value : values) {
            pieDataset.setValue(value != null ? "'" + value.toString() + "'" : "null", valuesFrequencies.get(value));
        }

        JFreeChart chart = ChartFactory.createPieChart(NbBundle.getMessage(ColumnValuesFrequency.class, "ColumnValuesFrequency.report.piechart.title"), pieDataset, false, true, false);
        return chart;
    }
View Full Code Here


    private DefaultPieDataset data;
    private ChartPanel chartPanel;

    public ContextPieChart() {
        data = new DefaultPieDataset();
        final JFreeChart chart = ChartFactory.createPieChart("Employee Survey", data, false, false, false);
        chart.setTitle(new TextTitle());
        chart.setBackgroundPaint(null);
        chart.setPadding(new RectangleInsets(0, 0, 0, 0));
        PiePlot plot = (PiePlot) chart.getPlot();
View Full Code Here

    public PartitionPie() {
        initComponents();
    }

    public void setup(Partition partition) {
        data = new DefaultPieDataset();
        for (Part p : partition.getParts()) {
            data.setValue(p.getDisplayName(), p.getPercentage());
        }
        final JFreeChart chart = ChartFactory.createPieChart("test", data, false, false, false);
        chart.setTitle(new TextTitle());
View Full Code Here

       
        return seriesKey;
    }

       public ChartFrame  jPieChart(String [] categories, double [] values, String chartTitle) {
           DefaultPieDataset data = new DefaultPieDataset();
           for (int k=0; k<values.length; k++
              data.setValue(categories[k], values[k]);
            m_chart = ChartFactory.createPieChart(chartTitle, data, true, true, true);
          
           ChartFrame cf = new ChartFrame("Pie Chart", m_chart);
           cf.setSize(defaultXSize, defaultYSize);
           cf.setVisible(true);
View Full Code Here

   return currentPlot.jplot(x.getv(), y.getv());
        }
       
   public static JFrame  jplot(String pieChartName, String[] categories, double [] values)
       {
           DefaultPieDataset  data = new DefaultPieDataset();
           for (int k=0; k<categories.length; k++)
            data.setValue(categories[k], new Double(values[k]));
         JFreeChart pieChart = ChartFactory.createPieChart(pieChartName, data, false, false, false);
         pieChart.setTitle("Category Plot "+pieChartName);
         JFrame pieFrame = new ChartFrame(pieChartName, pieChart);
         pieFrame.pack();
         pieFrame.setVisible(true);
View Full Code Here

    }
   
    protected void setUp() throws Exception {
        super.setUp();

        DefaultPieDataset data = new DefaultPieDataset();
        data.setValue("Java", new Double(43.2));
        data.setValue("Visual Basic", new Double(0.0));
        data.setValue("C/C++", new Double(17.5));
        mockChart = ChartFactory.createPieChart("Pie Chart", data, true, true, false);


        stack = ActionContext.getContext().getValueStack();
        ActionContext.getContext().setValueStack(stack);
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

   *
   * @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

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.