Package com.positive.charts.plot

Examples of com.positive.charts.plot.PiePlot


   * @since 1.0.7
   */
  public static Chart createPieChart(final String title,
      final PieDataset dataset, final boolean legend, final Locale locale) {

    final PiePlot plot = new PiePlot(dataset);
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator(locale));
    plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
    final Chart chart = new Chart(plot, legend);
    chart.setTitle(title);
    return chart;

  }
View Full Code Here


        ImageHyperlink createImageHyperlink = formToolkit
            .createImageHyperlink(bs, SWT.NONE);
        createImageHyperlink.setText(getChartName(hotSpotsByModule[a]));
        final Image image = new Image(Display.getCurrent(), 16, 16);
        GC gc = new GC(image);
        PiePlot plot = (PiePlot) ch.getPlot();
        String key = getChartName(hotSpotsByModule[a]) + " "
            + StringUtils.getPercentNumberString(value);
        gc.setBackground(plot.lookupSectionPaint(key, true));
        gc.fillRoundRectangle(0, 0, 16, 16, 2, 2);
        gc.dispose();
        final int b = a;
        createImageHyperlink.setImage(image);
        createImageHyperlink.addDisposeListener(new DisposeListener() {
View Full Code Here

    Chart chart = ChartFactory.createPieChart(title,
    // title
        dataset, // data
        true, Locale.getDefault()// include legend
        );
    PiePlot plot = (PiePlot) chart.getPlot();
    plot.setSectionOutlinesVisible(false);
    plot.setNoDataMessage("No data available");
    plot.setSimpleLabels(false);
    plot.setCircular(true);
    chart.setPadding(new RectangleInsets(0, 0, 0, 0));
    chart.removeLegend();
    return chart;
  }
View Full Code Here

TOP

Related Classes of com.positive.charts.plot.PiePlot

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.