Examples of PieDataset


Examples of ar.com.fdvs.dj.domain.chart.dataset.PieDataset

      case LINE_CHART:
        dataset = new CategoryDataset();
        plot = new LinePlot();
        break;
      case PIE_CHART:
        dataset = new PieDataset();
        plot = new PiePlot();
        break;
      case PIE3D_CHART:
        dataset = new PieDataset();
        plot = new Pie3DPlot();
        break;
      case TIMESERIES_CHART:
        dataset = new TimeSeriesDataset();
        plot = new TimeSeriesPlot();
View Full Code Here

Examples of com.positive.charts.data.general.PieDataset

   * @see #getDataset()
   */
  public void setDataset(final PieDataset dataset) {
    // if there is an existing dataset, remove the plot from the list of
    // change listeners...
    final 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

Examples of org.jfree.data.PieDataset

    }

    private static void drawImage(OutputStream os, int width, int height, double unavailable)
        throws Exception {
        // create dataset...
        final PieDataset dataset = createDataset(unavailable);
        // create the chart...
        final JFreeChart chart = createChart(dataset);
        // return as image
        // Encode as a JPEG
        JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder(os);
View Full Code Here

Examples of org.jfree.data.PieDataset

   }

    private static void drawImage(OutputStream os, int width, int height,
        Map<String, ObjectAttribute> whole, Map<String, ObjectAttribute> others) throws Exception {
        // create dataset...
        final PieDataset dataset = createDataset(whole, others);
        // create the chart...
        final JFreeChart chart = createChart(dataset);
        // return as image
        // Encode as a JPEG
        JPEGImageEncoder jpeg = JPEGCodec.createJPEGEncoder(os);
View Full Code Here

Examples of org.jfree.data.PieDataset

public class radar extends pspdash.CGIChartBase {

    /** Create a radar chart. */
    public JFreeChart createChart() {
        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

Examples of org.jfree.data.PieDataset

public class pie extends pspdash.CGIChartBase {

    /** Create a  line chart. */
    public JFreeChart createChart() {
        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

Examples of org.jfree.data.general.PieDataset

  }

  protected JFreeChart computeChart(final Dataset dataset)
  {

    PieDataset pieDataset = null;
    if (dataset instanceof PieDataset)
    {
      pieDataset = (PieDataset) dataset;
    }
View Full Code Here

Examples of org.jfree.data.general.PieDataset

  }


  protected void configureExplode(final PiePlot pp)
  {
    final PieDataset pieDS = pp.getDataset();

    final int explodeType = computeExplodeType();
    if (explodeType == EXPLODE_VALUE)
    {
      try
      {
        final int actualSegment = Integer.parseInt(explodeSegment);
        if (actualSegment >= 0)
        {
          pp.setExplodePercent(pieDS.getKey(actualSegment), explodePct.doubleValue());
        }
      }
      catch (Exception ignored)
      {
      }
      return;
    }

    // Calculate min and max...
    if (pieDS != null)
    {
      final int itemCount = pieDS.getItemCount();
      Number maxNum = new Double(Integer.MIN_VALUE);
      Number minNum = new Double(Integer.MAX_VALUE);
      int maxSegment = -1;
      int minSegment = -1;
      for (int i = 0; i < itemCount; i++)
      {
        final Number nbr = pieDS.getValue(i);
        if (nbr.doubleValue() > maxNum.doubleValue())
        {
          maxNum = nbr;
          maxSegment = i;
        }
        if (nbr.doubleValue() < minNum.doubleValue())
        {
          minNum = nbr;
          minSegment = i;
        }
      }

      if (explodeType == EXPLODE_MIN)
      { //$NON-NLS-1$
        if (minSegment >= 0)
        {
          pp.setExplodePercent(pieDS.getKey(minSegment), explodePct.doubleValue());
        }
      }
      else
      {
        if (maxSegment >= 0)
        {
          pp.setExplodePercent(pieDS.getKey(maxSegment), explodePct.doubleValue());
        }
      }
    }

  }
View Full Code Here

Examples of org.jfree.data.general.PieDataset

  {
    super.configureChart(chart);

    final Plot plot = chart.getPlot();
    final PiePlot pp = (PiePlot) plot;
    final PieDataset pieDS = pp.getDataset();
    pp.setDirection(rotationClockwise ? Rotation.CLOCKWISE : Rotation.ANTICLOCKWISE);
    if ((explodeSegment != null) && (explodePct != null))
    {
      configureExplode(pp);
    }
    if (StringUtils.isEmpty(getTooltipFormula()) == false)
    {
      pp.setToolTipGenerator(new FormulaPieTooltipGenerator(getRuntime(), getTooltipFormula()));
    }
    if (StringUtils.isEmpty(getUrlFormula()) == false)
    {
      pp.setURLGenerator(new FormulaPieURLGenerator(getRuntime(), getUrlFormula()));
    }

    pp.setIgnoreNullValues(ignoreNulls);
    pp.setIgnoreZeroValues(ignoreZeros);
    if (Boolean.FALSE.equals(getItemsLabelVisible()))
    {
      pp.setLabelGenerator(null);
    }
    else
    {
      final StandardPieSectionLabelGenerator labelGen = new StandardPieSectionLabelGenerator(pieLabelFormat);
      pp.setLabelGenerator(labelGen);

      final StandardPieSectionLabelGenerator legendGen = new StandardPieSectionLabelGenerator(pieLegendLabelFormat);
      pp.setLegendLabelGenerator(legendGen);
    }

    if (StringUtils.isEmpty(getLabelFont()) == false)
    {
      pp.setLabelFont(Font.decode(getLabelFont()));
    }

    if (pieDS != null)
    {
      final String[] colors = getSeriesColor();
      for (int i = 0; i < colors.length; i++)
      {
        if (i < pieDS.getItemCount())
        {
          pp.setSectionPaint(pieDS.getKey(i), parseColorFromString(colors[i]));
        }
        else
        {
          break;
        }
View Full Code Here

Examples of org.jfree.data.general.PieDataset

  public MasterReport createReport() throws ReportDefinitionException
  {
    final MasterReport report = parseReport();
    // create a dataset...
    final PieDataset dataset = createSampleDataset();
    // create the chart...
    final JFreeChart chart = createChart(dataset);
    report.getParameterValues().put("Chart", chart);
    return report;
  }
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.