package jfreechart; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartFrame; import org.jfree.chart.JFreeChart; import org.jfree.data.general.DefaultPieDataset; public class jfreecharttest { public static void main(String args[]){ //create a dataset DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("成都",100); dataset.setValue("绵阳",300); dataset.setValue("重庆",500); //create a chart JFreeChart chart = ChartFactory.createPieChart( "test pie chart", dataset, true, true, false ); //create and display a frame ChartFrame frame = new ChartFrame("test pie chart",chart); frame.pack(); frame.setVisible(true); } }
jfreechart文档中的例子
最新推荐文章于 2018-07-10 16:31:06 发布