- 浏览: 26690 次
- 性别:
- 来自: 潍坊
文章分类
最新评论
-
赤木晴子:
垃圾 没有jar包
struts2 velocity -
duronshi:
弱弱问下,如果我不用struts的标签<s:fo ...
struts2 基本校验 -
java_vm:
<div class="quote_title ...
struts2 基本校验 -
hyx0914:
呵呵,这样写的话为什么不在前台页面就验证了呢?
struts2 基本校验 -
chrislee1982:
还用这种方式验证?难道不知道可以使用xml配置或者annota ...
struts2 基本校验
显示效果:
先引入相关的jar包:
jcommon-1.0.12.jar jfreechart-1.0.9.jar struts2-jfreechart-plugin-2.1.6.jar
package com.example.struts.action; import jfreeChart.JfreeChartTest; import org.jfree.chart.JFreeChart; import com.opensymphony.xwork2.ActionSupport; @SuppressWarnings("serial") public class JfreeCharAction extends ActionSupport { /** * 定义JFreeChart对象 大家请注意在这里JFreeChart对象名只能为chart * 不能是别的 * 关于这点 * 大家可以上struts2网站上面查看一下 * * http://struts.apache.org/2.x/docs/jfreechart-plugin.html */ private JFreeChart chart; public JFreeChart getChart() { return chart; } public void setChart(JFreeChart chart) { this.chart = chart; } @Override public String execute() throws Exception { // 调用方法 this.chart = JfreeChartTest.createChart(); return SUCCESS; } }
package jfreeChart; import java.awt.Font; import java.io.IOException; import org.jfree.chart.ChartFactory; import org.jfree.chart.JFreeChart; import org.jfree.chart.plot.PiePlot; import org.jfree.data.general.DefaultPieDataset; public class JfreeChartTest { public static JFreeChart createChart() throws IOException { // 数据集 DefaultPieDataset dpd = new DefaultPieDataset(); dpd.setValue("管理人员", 25); dpd.setValue("市场人员", 25); dpd.setValue("开发人员", 45); dpd.setValue("其它人员", 10); // 创建PieChart对象 JFreeChart chart = ChartFactory.createPieChart3D("某公司人员组织结构图", dpd, true, true, false); utils.setFont(chart); return chart; } } /** * 设置字体 * * @author zyong * */ class utils { public static void setFont(JFreeChart chart) { Font font = new Font("宋体", Font.ITALIC, 12); PiePlot plot = (PiePlot) chart.getPlot(); chart.getTitle().setFont(font); plot.setLabelFont(font); chart.getLegend().setItemFont(font); } }
<struts> <!-- 关于extends继承jfreechart-default这点请大家注意 因为在struts-default这个包里并没有result-type为chart的 chart 定义在前面我们导入的struts2-jfreechart-plugin-2.1.6.jar 下面的struts-plugin.xml文件中 --> <package name="jfreechart" extends="jfreechart-default"> <action name="jfreechart" class="com.example.struts.action.JfreeCharAction"> <result name="success" type="chart"> <param name="width">600</param> <param name="height">400</param> </result> </action> </package> </struts>
评论
11 楼
sdsd12334
2010-08-12
有没有做得更加通用一点的方法,按按照你的做法,那不同的图形就要写不同的类或是多个不同的方法去生成。代码复用性不强。
10 楼
mib168
2010-08-04
FusionCharts Free报表出来的图形给人感觉不错呀 呵呵
一般的应用估计这个够了。
一般的应用估计这个够了。
9 楼
xiaoye4188
2010-07-30
viei 写道
还是用fusioncharts之类的flash报表软件方便美观点
支持 上次稍微看了下fusioncharts的画图种类 很丰富
8 楼
harbey
2010-07-27
ireport + jasperreport开发报表也可以,但是开发复杂的报表就不怎么适合了,例如多个数据源的报表或则负责度在大点的,麻烦好多,好约束!
7 楼
happysoul
2010-07-27
感觉越来越多的报表类项目都改用 Flex 去做了。。
毕竟图形化的东西还是flash比较适合
毕竟图形化的东西还是flash比较适合
6 楼
jy00314996
2010-07-27
我这有些资料,当然只是的Html 并没有后台方面的 LZ想要的话 可以给你整理个
5 楼
sunliao_first
2010-07-27
只要符合应用就行,适合客户才是硬道理!
4 楼
javajdbc
2010-07-27
我一直都在用 jfreechart 生成表报
LS 说的基于 flash or javascript 能举个例子吗? 详解
LS 说的基于 flash or javascript 能举个例子吗? 详解
3 楼
yideng
2010-07-26
jfreechart 落伍了 现在有好多更优秀的工具 基于flash or javascript 的
2 楼
snail_fish
2010-07-26
这就算整合了啊 呵呵
1 楼
viei
2010-07-26
还是用fusioncharts之类的flash报表软件方便美观点
发表评论
-
struts2 以注解的形式实现拦截器
2010-07-26 08:48 830package com.example.struts.acti ... -
struts2 国际化(中英文切换 占位符)
2010-07-26 08:13 2094package com.example.struts.acti ... -
struts2 基本校验(配置文件形式)
2010-07-26 07:56 1209利用配置文件进行校验主要是增加了一些xml文件来对具体表单 ... -
struts2 基本校验
2010-07-26 07:26 993Struts2对输入校验这方面采用的最基本方 ... -
struts2 全局异常提示定义属性文件使用
2010-07-25 15:30 1184#类型转换提示 xwork.default.invalid. ... -
struts2 类型转换
2010-07-25 15:05 1017在Web项目开发中由于很多数据在页面上显示时候都是 ... -
struts2 freemarker
2010-07-25 14:32 1785freemarker和velocity一样也是一种可以 ... -
struts2 velocity
2010-07-25 14:00 1867velocity翻译成中文就是“速度”的意思,它 ... -
struts2 表单标签的使用
2010-07-25 13:39 1263combobox标签 ... -
struts2 OGNL 表达式及各种标签的使用
2010-07-25 13:24 2064Struts2中将 ... -
struts2 文件的上传和下载
2010-07-25 12:54 2076在Web项目中导入支持文件上传下载和IO输入输出的两个 ... -
struts2 拦截器的使用(继承方法拦截器)
2010-07-24 16:02 1867import com.opensymphony.xwork2. ... -
struts2 拦截器的使用(继承抽象拦截器)
2010-07-24 15:51 1110import com.opensymphony.xwork2. ... -
struts2 type 常量
2010-07-24 15:43 853Type类型值 作用说明 对应类 ... -
struts2学习总结( 使用ActionSupport进行校验)
2010-07-24 15:29 1462= Action类中ActionSupport使用 ... -
Strut2 学习总结(1)基本配置
2010-07-24 11:05 863开发所必备的基本jar包: struts2- ...
相关推荐
NULL 博文链接:https://jackaney.iteye.com/blog/1041025
这是一个Struts2与JFreechart的整合实例,很简单,看完也就会啦
使用JFreeChart,必须调用在web-inf目录下导入jfreechart.jar,和jcommon.jar包 使用jfreechart-1.0.13.jar查看图表时中文乱码,降低jfreechart版本ok 显示图表时都可以在获取JfreeChart对象方法中使用3D方式 ...
struts2整合 jfreechart 实现报表组件
本程序主要是struts2和JFreeChart整合!如果有什么疑问可以直接给我留言!!
struts2整合JFreechart: jcommon-1.0.16.jar jfreechart-1.0.13.jar struts2-jfreechart-plugin-2.0.11.jar 导成图片操作说明
struts2整合jfreechart简单实用实例,包含饼状图、柱状图、折线图.
Struts2整合JFreeChart 实现柱状图表、Struts2整合JFreeChart 实现柱状图表、Struts2整合JFreeChart 实现柱状图表。
liyong struts2与jfreechart的整合 生成统计图表
Struts+jfreeChart整合注意事项以及代码实现
一个完整的JSP struts2整合jfreechart的例子
Struts2应用开发系列Struts2整合JFreeChart
Struts2应用开发系列Struts2整合JFreeChart
Struts2应用开发系列Struts2整合JFreeChart
Struts2应用开发系列Struts2整合JFreeChart
Struts2应用开发系列Struts2整合JFreeChart
Struts2应用开发系列Struts2整合JFreeChart
Struts2应用开发系列Struts2整合JFreeChart
Struts2应用开发系列Struts2整合JFreeChart