FusionChartsFree用法简介
最近在公司做报表,学习了一些FusionChartsFree用法。具体FusionChartsFree是什么东东,自己到google里找答案。
首先来做一个柱型图:
/**
* 统计一周内的销售金额,在action中构造显示图形的字符串
*/
public String getDateList(String caption, String subCaption, String xAxisName, String yAxisName, int yAxisMinValue,
int decimalPrecision, int formatNumberScale, int showNames, int showValues, int showAlternateHGridColor,
String AlternateHGridColor, String divLineColor, int divLineAlpha, int alternateHGridAlpha) {
IScmSellDeliveryManager sellDeliveryMagt = ServiceLocator.getInstance().lookup(IScmSellDeliveryManager.class);
List<Date> dateList = new ArrayList<Date>();
for (int i = -6; i < 0; i++) {
dateList.add(ComputeDateUtils.getDate(i));
}
dateList.add(new Date());//获得X方向的数据
List<Double> amountList = sellDeliveryMagt.countWeekAmountByDate(new Date());//获得Y方向的数据
SimpleDateFormat sdf = new SimpleDateFormat("yy-MM-dd");
StringBuffer head = new StringBuffer();
head
.append("<graph caption='"
+ caption
+ "' subCaption = '"
+ subCaption
+ "' xAxisName='"
+ xAxisName
+ "' yAxisMinValue='0' yAxisName='"
+ yAxisName
+ "' decimalPrecision='0' formatNumberScale='0' showNames='1' showValues='0' showAlternateHGridColor='1' AlternateHGridColor='ff5904' divLineAlpha='5' alternateHGridAlpha='5'>");
for (int i = 0; i < dateList.size(); i++) {
if (i < amountList.size() && amountList.size() > 0 && null != amountList && null != amountList.get(i)) {
head.append("<set name='" + sdf.format(dateList.get(i)) + "' value='" + amountList.get(i)
+ "' hoverText='销售金额'/>");
} else {
head.append("<set name='" + sdf.format(dateList.get(i)) + "'/>");
}
}
head.append("</graph>");
return head.toString();
}
上面的方法主要是构造了一个很长的字符串,每一种图形的字符串的格式是不一样的。具体可以参看下面的FusionChartsFree包,它里面有各种各样的图形的xml格式说明,要想构造成它的图形构造出它的字符串就可以了,当然还有一种静态的图形,FusionChartsFree包有静态的例子F:\张明学\FusionChartsFree\FusionChartsFree\Code\MyFirstChart文本里面,先把数据写在xml中,在html中的js中构造一个FusionCharts对象并指定它的xml位置就可以了。这个方法自己去看FusionChartsFree包。
接着说上面的用法,在action中动态生成好相应的字符串之后,在而面访问它可以了。
<div style="width:width:50%;overflow:auto;">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase= http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="610" height="400" id="Column" >
<param name="movie" value="${ctxPath}/FusionCharts/FCF_Column3D.swf" />
<param name="FlashVars" value="&chartWidth=610&chartHeight=400&dataXML=${action.head!}">//访问action中的那个字符串。这是公司的框架,这样可以访问action中中数据,各位在这样可以相应的变化。
<param name="quality" value="high" />
<embed src="${ctxPath}/FusionCharts/FCF_Column3D.swf" wmode="opaque" flashVars="&chartWidth=610&chartHeight=400&dataXML=${action.head!}" quality="high" width="610" height="400" name="MSColumn3D" type="application/x-shockwave-flash" pluginspage=" http://www.macromedia.com/go/getflashplayer" />
</object>
</div>
好了,这样flash就可以显示出来了。
FusionChartsFree用法简介相关推荐
- MSSQL Sql加密函数 hashbytes 用法简介
原文:MSSQL Sql加密函数 hashbytes 用法简介 转自:http://www.maomao365.com/?p=4732 一.mssql sql hashbytes 函数简介 hashb ...
- Postman用法简介-Http请求模拟工具
Postman用法简介-Http请求模拟工具 在我们平时开发中,特别是需要与接口打交道时,无论是写接口还是用接口,拿到接口后肯定都得提前测试一下,这样的话就非常需要有一个比较给力的Http请求模拟工具 ...
- InputStreamReader 和 OutputStreamWriter类用法简介,及演示。
InputStreamReader 和 OutputStreamWriter类用法简介. 一.InputStreamReader类 InputStreamReader 将字节流转换为字符流.是字节流通 ...
- php中__FILE__常量用法简介
php中__FILE__常量用法简介 http://blog.csdn.net/xbei07/article/details/5616020#comments出处 1.php中的__FILE__常量返 ...
- java test 用法,pytest基本用法简介
1.安装pytest,打开dos窗口输入: pip install pytest 2.通过pycharm工具下载 3.创建pytest测试用例步骤 # 定义测试类 class testdivide: ...
- SAP Gateway与OData用法简介
本文将分别从基础原理和实际应用两个角度介绍SAP Gateway与OData相关的知识点. 1 相关的事务代码(t-code) SEGW - SAP Gateway Service Builder / ...
- Matlab中 intlinprog函数用法简介
Matlab中 intlinprog函数用法简介 本来想要自己亲手写一遍的,发现了一优质博文基本上跟我做过的例题大差不差,所以就直接放上链接. 参考链接 https://www.cnblogs.com ...
- intersect的用法简介
intersect的用法简介 在Oracle中,"A minus B"用于将结果集B中含有的记录从结果集A中移除,即用于获取存在于结果集A中而不存在于结果集B中的记录:" ...
- Oracle SQL调优系列之no_unnest和unnest用法简介
Oracle调优之no_unnest和unnest用法简介 本博客介绍Oracle SQL调优的一种常用也是很实用的方法,也即/*+no_unnest */和/*+ unnest*/,介绍Oracle ...
- 安装bwa软件linux,bwa软件用法简介
本文全文摘抄于简书:bwa软件用法简介 仅用于方便个人学习,如有侵权,请提醒删除,谢谢 bwa 是一款将序列比对到参考基因组上的软件,包含了以下3种算法 BWA-backtrack BWA-SW BW ...
最新文章
- html弹窗确认取消公告代码,js 弹出确认与取消对话框的四种方法
- 如何使用纯 CSS 创建翻牌动画
- 快速安装Git客户端及TortoiseGit并使用
- 单例设计模式和多线程
- [java] Unsupported major.minor version 51.0 错误解决方案
- oracle启动数据库错误
- hive sql脚本学习
- IOS swift 清理缓存
- python批量转换图片格式:JPEG到jpg
- 解决ubuntu 16.04 启动黑屏,出现dev/sda7: clean, xxx/xxx files, xxx/xxx blocks字样问题
- 大数据破获网售假耐克案
- 每周一品 · 直线电机(Linear Motor)中的磁性材料
- VS2015编译适用于XP系统sp3的dll全过程-无需vs2015运行库
- 多益网络_网络安全的未来日益激烈的信息控制之战
- 为什么人人都爱康师傅
- 计算机基础课程听课记录,听课记录-计算机应用基础
- 【Paper Reading FedBCD: A Communication-Efficient Collaborative Learning Framework for DF
- 彩色图片亮度放大后 色彩不失真的方法
- 不积跬步无以至千里,我与CSDN不平凡的2021年
- 华为ax3怎么接光纤sc接口_华为路由器AX3 Pro与其他华为/荣耀路由器如何连接?...