<%@ page language="java"
 import="java.util.*,org.jfree.chart.title.TextTitle,java.awt.Font,org.jfree.chart.plot.PiePlot"
 pageEncoding="GB18030"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page import="org.jfree.data.general.DefaultPieDataset"%>
<%@ page import="org.jfree.chart.ChartFactory"%>
<%@ page import="org.jfree.chart.JFreeChart"%>
<%@ page import="org.jfree.chart.servlet.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
 <head>
  <base href="<%=basePath%>">  <title>http://www.0dis.cn</title>
  <meta http-equiv="pragma" content="no-cache">
  <meta http-equiv="cache-control" content="no-cache">
  <meta http-equiv="expires" content="0">
  <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  <meta http-equiv="description" content="This is my page">
  <!--
 <link rel="stylesheet" type="text/css" href="styles.css">
 -->
 </head> <body>
更多J2EE视频和源码请访问:http://www.0dis.cn 零距离  <%
DefaultPieDataset dpd = new DefaultPieDataset();
dpd.setValue("管理人员",25);
dpd.setValue("市场人员",25);
dpd.setValue("开发人员",40);
dpd.setValue("其他人员",10);
JFreeChart chart = ChartFactory.createPieChart3D("某公司人员组织结构图",dpd,true,true,false);
chart.setTitle(new TextTitle("某公司人员组织结构图", new Font("黑体", Font.BOLD, 20)));
Font font = new Font("SimSun", 10, 20); 
TextTitle txtTitle = null; 
txtTitle = chart.getTitle(); 
txtTitle.setFont(font); 
PiePlot pieplot = (PiePlot)chart.getPlot(); 
pieplot.setLabelFont(font); 
chart.getLegend().setItemFont(font); String filename = ServletUtilities.saveChartAsPNG(chart,800,600,session);
String url= request.getContextPath()+"/DisplayChart?filename="+filename;
%>
  <img src="<%= url %>" width="800" height="600">
 </body>
</html>更多J2EE的源码和解决方案,请访问我的个站:http://www.0dis.cn 
谢谢