1 38 39 package org.jfree.chart.demo; 40 41 import org.jfree.chart.ChartFactory; 42 import org.jfree.chart.ChartFrame; 43 import org.jfree.chart.JFreeChart; 44 import org.jfree.data.DefaultPieDataset; 45 46 53 public class First { 54 55 60 public static void main(String [] args) { 61 62 DefaultPieDataset data = new DefaultPieDataset(); 64 data.setValue("Category 1", 43.2); 65 data.setValue("Category 2", 27.9); 66 data.setValue("Category 3", 79.5); 67 68 JFreeChart chart = ChartFactory.createPieChart( 70 "Sample Pie Chart", 71 data, 72 true, true, false ); 76 77 ChartFrame frame = new ChartFrame("First", chart); 79 frame.pack(); 80 frame.setVisible(true); 81 82 } 83 84 } 85 | Popular Tags |