Examples of PiePlot3D


Examples of org.jfree.chart.plot.PiePlot3D

   */
  protected JFreeChart createPie3DChart() throws JRException
  {
    JFreeChart jfreeChart = super.createPie3DChart();

    PiePlot3D piePlot3D = (PiePlot3D) jfreeChart.getPlot();
    if(piePlot3D.getLabelGenerator() != null)
    {
      piePlot3D.setLabelBackgroundPaint(ChartThemesConstants.TRANSPARENT_PAINT);
      piePlot3D.setLabelShadowPaint(ChartThemesConstants.TRANSPARENT_PAINT);
      piePlot3D.setLabelOutlinePaint(ChartThemesConstants.TRANSPARENT_PAINT);
    }
    piePlot3D.setDarkerSides(true);
    piePlot3D.setDepthFactor(0.1);
// does not work for 3D
//    piePlot3D.setShadowXOffset(5);
//    piePlot3D.setShadowYOffset(10);
//    piePlot3D.setShadowPaint(new GradientPaint(
//        0,
//        getChart().getHeight() / 2,
//        new Color(41, 120, 162),
//        0,
//        getChart().getHeight(),
//        Color.white)
//    );

    PieDataset pieDataset = piePlot3D.getDataset();
    if(pieDataset != null)
    {
      for(int i = 0; i < pieDataset.getItemCount(); i++)
      {
        piePlot3D.setSectionOutlinePaint(pieDataset.getKey(i), ChartThemesConstants.TRANSPARENT_PAINT);
      }
    }

    piePlot3D.setCircular(true);
    return jfreeChart;
  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        true,
        true,
        false
        );

    PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(290);
    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    /*   */
    this.setVariableValue("Chart", new JCommonDrawableRenderer(chart));
  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        false
    );

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.yellow);
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    return chart;

  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        false
    );

    // set the background color for the chart...
    chart.setBackgroundPaint(Color.yellow);
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    return chart;

  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        true,
        false
    );

    // set the background color for the chart...
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    return chart;

  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        true,
        false
    );

    // set the background color for the chart...
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    return chart;

  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        true,
        false
    );

    // set the background color for the chart...
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    return chart;

  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        true,
        false
    );

    // set the background color for the chart...
    final PiePlot3D plot = (PiePlot3D) chart.getPlot();
    plot.setStartAngle(270);
//    plot.setDirection(Rotation.CLOCKWISE);
    plot.setForegroundAlpha(0.5f);
    plot.setNoDataMessage("No data to display");

    return chart;

  }
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

        true, // include legend
        true, true);

    // chart.getTitle().setFont(new Font("新細明體", Font.BOLD, 20));
    chart.getLegend().setItemFont(new Font("微軟正黑體", Font.PLAIN, 15));
    PiePlot3D pieplot3d = (PiePlot3D) chart.getPlot();
    pieplot3d.setLabelFont(new Font("微軟正黑體", Font.PLAIN, 12));
    pieplot3d.setLabelGenerator(new   StandardPieSectionLabelGenerator( "{0}--{2}"));

    ChartPanel cp = new ChartPanel(chart);
    cp.setPreferredSize(new java.awt.Dimension(600, 300));

    return cp;
View Full Code Here

Examples of org.jfree.chart.plot.PiePlot3D

   * @param data
   */
  public static void drawPie(String name, String outputFileName, List<Entry> data) {
    PieDataset dataset = makePieDataSet(data)
    JFreeChart chart = ChartFactory.createPieChart3D(name, dataset, true, true, false)
    PiePlot3D  plot = (PiePlot3D)chart.getPlot()
    // 图片中显示百分比:默认方式 
    //plot.setLabelGenerator(new           StandardPieSectionLabelGenerator(StandardPieToolTipGenerator.DEFAULT_TOOLTIP_FORMAT)); 
    // 图片中显示百分比:自定义方式,{0} 表示选项, {1} 表示数值, {2} 表示所占比例 ,小数点后两位 
    plot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0}={1}({2})", NumberFormat.getNumberInstance(), new DecimalFormat("0.00%")));  
    // 图例显示百分比:自定义方式, {0} 表示选项, {1} 表示数值, {2} 表示所占比例                 
    plot.setLegendLabelGenerator(new StandardPieSectionLabelGenerator("{0}={1}({2})"));  
    // 设置背景色为白色  
    chart.setBackgroundPaint(Color.white);  
    // 指定图片的透明度(0.0-1.0)  
    plot.setForegroundAlpha(1.0f);  
    // 指定显示的饼图上圆形(false)还椭圆形(true)  
    plot.setCircular(true);  
    // 设置图标题的字体  
    Font font = new Font("黑体",Font.CENTER_BASELINE,20);  
    TextTitle title = new TextTitle(name);  
    title.setFont(font);   
    chart.setTitle(title);  
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.