Package org.jfree.data.general

Examples of org.jfree.data.general.PieDataset


            return true;
        }
        if (!(obj instanceof PieDataset)) {
            return false;
        }
        PieDataset that = (PieDataset) obj;
        int count = getItemCount();
        if (that.getItemCount() != count) {
            return false;
        }
        for (int i = 0; i < count; i++) {
            Comparable k1 = getKey(i);
            Comparable k2 = that.getKey(i);
            if (!k1.equals(k2)) {
                return false;
            }

            Number v1 = getValue(i);
            Number v2 = that.getValue(i);
            if (v1 == null) {
                if (v2 != null) {
                    return false;
                }
            }
View Full Code Here


     * @see #getDataset()
     */
    public void setDataset(PieDataset dataset) {
        // if there is an existing dataset, remove the plot from the list of
        // change listeners...
        PieDataset existing = this.dataset;
        if (existing != null) {
            existing.removeChangeListener(this);
        }

        // set the new dataset, and register the chart as a change listener...
        this.dataset = dataset;
        if (dataset != null) {
View Full Code Here

    /** Create a radar chart. */
    @Override
    public JFreeChart createChart() {
        maybeScaleDataAxes();
        CategoryDataset catData = data.catDataSource();
        PieDataset pieData = null;
        if (catData.getRowCount() == 1)
            pieData = DatasetUtilities.createPieDatasetForRow(catData, 0);
        else
            pieData = DatasetUtilities.createPieDatasetForColumn(catData, 0);

View Full Code Here

    }

    public static JFreeChart createDiscChart(ResultSet data, Map parameters) {
        // data.sortBy(1, true);
        CategoryDataset catData = data.catDataSource();
        PieDataset pieData = null;
        if (catData.getColumnCount() == 1)
            pieData = DatasetUtilities.createPieDatasetForColumn(catData, 0);
        else
            pieData = DatasetUtilities.createPieDatasetForRow(catData, 0);
View Full Code Here

     * @see #getDataset()
     */
    public void setDataset(PieDataset dataset) {
        // if there is an existing dataset, remove the distributor from the
        // list of change listeners...
        PieDataset existing = this.dataset;
        if (existing != null) {
            existing.removeChangeListener(this);
        }

        // set the new dataset, and register the distributor as a change
        // listener...
        this.dataset = dataset;
View Full Code Here

    /** Create a  line chart. */
    @Override
    public JFreeChart createChart() {
        CategoryDataset catData = data.catDataSource();
        PieDataset pieData = null;
        if (catData.getColumnCount() == 1)
            pieData = DatasetUtilities.createPieDatasetForColumn(catData, 0);
        else
            pieData = DatasetUtilities.createPieDatasetForRow(catData, 0);

View Full Code Here

        piePlot.setLabelGenerator(null);

      // The following section deals with whether individual pie sections are exploded or not.
      // Although PiePlot3D extends PiePlot, it does not support exploded sections.
      if (! (plot instanceof PiePlot3D)) {
        PieDataset ds = piePlot.getDataset();

        for (Iterator paramIter=params.entrySet().iterator(); paramIter.hasNext(); ) {
          Map.Entry entry = (Map.Entry) paramIter.next();
          String paramKey = (String) entry.getKey();
          if (paramKey.startsWith("explode_")) {
            double explodePercent = Double.valueOf(paramKey.substring(8)).doubleValue();
            String paramValue = (String) entry.getValue();

            for (Iterator keyIter=ds.getKeys().iterator(); keyIter.hasNext(); ) {
              Comparable key = (Comparable) keyIter.next();
              if (key.equals(paramValue)) {
                piePlot.setExplodePercent(key, explodePercent);
              }
            }
View Full Code Here

            .generateToolTip((XYDataset) dataset, xyEnt.getSeriesIndex(), xyEnt.getItem());
        }
    } else if (toolTipGenerator instanceof PieToolTipGenerator) {
        if (ce instanceof PieSectionEntity) {
        PieSectionEntity pieEnt = (PieSectionEntity) ce;
        PieDataset ds = (PieDataset) dataset;
        final int index = pieEnt.getSectionIndex();
        tooltip = ((PieToolTipGenerator) toolTipGenerator)
            .generateToolTip(ds, ds.getKey(index), index);
        }
    } else {
      // throw because category is unknown
        throw new JspException("TooltipgGenerator of class " + toolTipGenerator.getClass().getName()
        + " does not implement the appropriate TooltipGenerator interface for entity type " + ce.getClass().getName());
View Full Code Here

    return new JFreeChart(reportChart.getTitle(), JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
  }
 
  private JFreeChart createPieChart(ReportChart reportChart, ChartValue[] values, boolean displayInline)
  {
    PieDataset dataset = createPieDataset(values);   
   
    PiePlot3D plot = new PiePlot3D(dataset);
    plot.setToolTipGenerator(new StandardPieToolTipGenerator());
   
    if (reportChart.getDrillDownReport() != null)
View Full Code Here

 

  private JFreeChart createRingChart(ReportChart reportChart,
      ChartValue[] values, boolean displayInline)
  {
    PieDataset dataset = createPieDataset(values);

    RingPlot plot = new RingPlot(dataset);
    plot.setToolTipGenerator(new StandardPieToolTipGenerator());

    if (reportChart.getDrillDownReport() != null)
View Full Code Here

TOP

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

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.