Java pie chart 3D effect

Source: Internet
Author: User
Package pie; import Java. AWT. font; import Java. AWT. renderinghints; import Org. jfree. chart. chartfactory; import Org. jfree. chart. chartframe; import Org. jfree. chart. jfreechart; import Org. jfree. chart. plot. pieplot3d; import Org. jfree. data. general. defaultpiedataset; import Org. jfree. UI. refineryutilities; public class jfree {public static void createpiechart () {// create a 3D pie chart through the project jfreechart piechart = chartfactory. createpiechart3d ("the most popular idol drama 2008-2010", createdataset (), true, true, false); piechart. getrenderinghints (). put (renderinghints. key_text_antialiasing, renderinghints. value_text_antialias_off); // obtain the Plut object pieplot3d pieplot = (pieplot3d) piechart of the 3D pie chart. getplot (); // sets the transparency pieplot. setforegroundalpha (0.5f); pieplot. setlabelfont (new font ("", Font. plain, 12); // set the title Font piechart. gettitle (). setfont (new font ("", Font. bold, 20); // set the legend category font piechart. getlegend (). setitemfont (new font ("", Font. bold, 14); chartframe frame = new chartframe ("testpiechart", piechart); frame. pack (); refineryutilities. centerframeonscreen (FRAME); frame. setvisible (true);} public static defaultpiedataset createdataset () {defapipiedataset piedataset = new defaultpiedataset (); piedataset. setvalue ("Limit mit", 2.80); piedataset. setvalue ("Peach Blossom and love are invincible", 3.63); piedataset. setvalue ("prank kiss", 2.84); Return piedataset;} public static void main (string [] ARGs) {createpiechart ();}}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.