<%@ 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
谢谢
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
谢谢
解决方案 »
- 实现批上传下载进度条
- 如何用程序的方式,从 PropertyPlaceholderConfigurer 获取配置
- 求助用JAVA编程模拟ATM机进行账户余额查询。
- Lucene 的中文 高亮显示出错 (兄弟帮忙紧急)
- 有关proxool的监控的问题
- oracle中与||功能相同的是哪个?十个选择题,但记不清选项,有谁知道答案呢?
- hibernate查询语言外连接的问题
- 请问怎么做从数据库到内存的缓存?
- 高分求可上载的FTP,用于上传Struts中文资源。
- xml 流化时出现的权限问题?
- log4j 控制台日志大小限制 求助!
- 在提交j_spring_security_check登录后,重定向到login_process.jspa,在login_process Action中如何得到 登录Form中其他一些input参数
"走势图",
"时间",
"值",
xydataset,
true,
true,
true
);
chart.setBackgroundPaint(Color.white);//设置曲线图背景色
chart.setTitle(new TextTitle("走势图",new Font("SimSun", 1, 10)));
我有同样的问题,Title是正常了,但“时间”和“值”还是乱码,这个怎么解决了?