Examples of RingPlot


Examples of org.jfree.chart.plot.RingPlot

  protected void configureChart(final JFreeChart chart)
  {
    super.configureChart(chart);

    final RingPlot ringPlot = (RingPlot) chart.getPlot();
    ringPlot.setSectionDepth(sectionDepth);
  }
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

  protected void configureChart(final JFreeChart chart)
  {
    super.configureChart(chart);

    final RingPlot ringPlot = (RingPlot) chart.getPlot();
    ringPlot.setSectionDepth(sectionDepth);
  }
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

     * @since 1.0.7
     */
    public static JFreeChart createRingChart(String title, PieDataset dataset,
            boolean legend, boolean tooltips, Locale locale) {

        RingPlot plot = new RingPlot(dataset);
        plot.setLabelGenerator(new StandardPieSectionLabelGenerator(locale));
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
        if (tooltips) {
            plot.setToolTipGenerator(new StandardPieToolTipGenerator(locale));
        }
        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
                plot, legend);
        currentTheme.apply(chart);
        return chart;
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

                                             PieDataset dataset,
                                             boolean legend,
                                             boolean tooltips,
                                             boolean urls) {

        RingPlot plot = new RingPlot(dataset);
        plot.setLabelGenerator(new StandardPieSectionLabelGenerator());
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
        if (tooltips) {
            plot.setToolTipGenerator(new StandardPieToolTipGenerator());
        }
        if (urls) {
            plot.setURLGenerator(new StandardPieURLGenerator());
        }
        JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT,
                plot, legend);
        currentTheme.apply(chart);
        return chart;
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

  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)
    {
      plot.setURLGenerator(new StandardPieURLGenerator(
          "executeReport.action?displayInline=" + displayInline
              + "&exportType=0&reportId="
              + reportChart.getDrillDownReport().getId(),
          ReportChart.DRILLDOWN_PARAMETER, "pieIndex"));
    }
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

        pieDataset.setValue(key + " " + amount, new Double(chartData.getChartKunInvoiceAmount().doubleValue()));
      }

      String title = "Monthly amount for year 2009";
      JFreeChart chart = ChartFactory.createRingChart(title, pieDataset, true, true, true);
      RingPlot plot = (RingPlot) chart.getPlot();
      plot.setForegroundAlpha(0.5f);
      BufferedImage bi = chart.createBufferedImage(chartWidth, chartHeight, BufferedImage.TRANSLUCENT, null);
      byte[] bytes = EncoderUtil.encode(bi, ImageFormat.PNG, true);

      AImage chartImage = new AImage("Ring Chart", bytes);
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

    /**
     * Some checks for the equals() method.
     */
    public void testEquals() {

        RingPlot plot1 = new RingPlot(null);
        RingPlot plot2 = new RingPlot(null);
        assertTrue(plot1.equals(plot2));
        assertTrue(plot2.equals(plot1));

        // separatorsVisible
        plot1.setSeparatorsVisible(false);
        assertFalse(plot1.equals(plot2));
        plot2.setSeparatorsVisible(false);
        assertTrue(plot1.equals(plot2));

        // separatorStroke
        Stroke s = new BasicStroke(1.1f);
        plot1.setSeparatorStroke(s);
        assertFalse(plot1.equals(plot2));
        plot2.setSeparatorStroke(s);
        assertTrue(plot1.equals(plot2));

        // separatorPaint
        plot1.setSeparatorPaint(new GradientPaint(1.0f, 2.0f, Color.red,
                2.0f, 1.0f, Color.blue));
        assertFalse(plot1.equals(plot2));
        plot2.setSeparatorPaint(new GradientPaint(1.0f, 2.0f, Color.red,
                2.0f, 1.0f, Color.blue));
        assertTrue(plot1.equals(plot2));

        // innerSeparatorExtension
        plot1.setInnerSeparatorExtension(0.01);
        assertFalse(plot1.equals(plot2));
        plot2.setInnerSeparatorExtension(0.01);
        assertTrue(plot1.equals(plot2));

        // outerSeparatorExtension
        plot1.setOuterSeparatorExtension(0.02);
        assertFalse(plot1.equals(plot2));
        plot2.setOuterSeparatorExtension(0.02);
        assertTrue(plot1.equals(plot2));

        // sectionDepth
        plot1.setSectionDepth(0.12);
        assertFalse(plot1.equals(plot2));
        plot2.setSectionDepth(0.12);
        assertTrue(plot1.equals(plot2));

    }
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

    /**
     * Confirm that cloning works.
     */
    public void testCloning() {
        RingPlot p1 = new RingPlot(null);
        GradientPaint gp = new GradientPaint(1.0f, 2.0f, Color.yellow,
                3.0f, 4.0f, Color.red);
        p1.setSeparatorPaint(gp);
        RingPlot p2 = null;
        try {
            p2 = (RingPlot) p1.clone();
        }
        catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        assertTrue(p1 != p2);
        assertTrue(p1.getClass() == p2.getClass());
        assertTrue(p1.equals(p2));
    }
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

    /**
     * Serialize an instance, restore it, and check for equality.
     */
    public void testSerialization() {

        RingPlot p1 = new RingPlot(null);
        GradientPaint gp = new GradientPaint(1.0f, 2.0f, Color.yellow,
                3.0f, 4.0f, Color.red);
        p1.setSeparatorPaint(gp);
        RingPlot p2 = null;
        try {
            ByteArrayOutputStream buffer = new ByteArrayOutputStream();
            ObjectOutput out = new ObjectOutputStream(buffer);
            out.writeObject(p1);
            out.close();
View Full Code Here

Examples of org.jfree.chart.plot.RingPlot

        chart2.addSubtitle(new TextTitle("Subtitle"));
        assertTrue(chart1.equals(chart2));

        // plot
        chart1 = new JFreeChart("Title",
                new Font("SansSerif", Font.PLAIN, 12), new RingPlot(), false);
        chart2 = new JFreeChart("Title",
                new Font("SansSerif", Font.PLAIN, 12), new PiePlot(), false);
        assertFalse(chart1.equals(chart2));
        chart2 = new JFreeChart("Title",
                new Font("SansSerif", Font.PLAIN, 12), new RingPlot(), false);
        assertTrue(chart1.equals(chart2));

        // backgroundPaint
        chart1.setBackgroundPaint(new GradientPaint(1.0f, 2.0f, Color.red,
                3.0f, 4.0f, Color.blue));
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.