文件名称:jfreechart 饼形图
文件大小:1KB
文件格式:ZIP
更新时间:2015-04-07 05:28:10
jfreechart 饼形图
jfreechart百分比在饼上, 有分离的饼。 private static JFreeChart createChart(PieDataset piedataset) { JFreeChart jfreechart = ChartFactory.createPieChart("Pie Chart Demo 2", piedataset, true, true, false); PiePlot pieplot = (PiePlot)jfreechart.getPlot(); pieplot.setSectionPaint("One", new Color(160, 160, 255)); pieplot.setSectionPaint("Two", new Color(128, 128, 223)); pieplot.setSectionPaint("Three", new Color(96, 96, 191)); pieplot.setSectionPaint("Four", new Color(64, 64, 159)); pieplot.setSectionPaint("Five", new Color(32, 32, 127)); pieplot.setSectionPaint("Six", new Color(0, 0, 111)); pieplot.setNoDataMessage("No data available"); pieplot.setExplodePercent("Two", 0.20000000000000001D); pieplot.setLabelGenerator(new StandardPieSectionLabelGenerator("{0} ({2} percent)")); pieplot.setLabelBackgroundPaint(new Color(220, 220, 220)); pieplot.setLegendLabelToolTipGenerator(new StandardPieSectionLabelGenerator("Tooltip for legend item {0}")); pieplot.setSimpleLabels(true); pieplot.setInteriorGap(0.0D); return jfreechart; }
【文件预览】:
PieChartDemo2.java