open flash chart2 报表

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
	<head>
		<script type="text/javascript" src="<c:url value="/scripts/js/swfobject.js"/>"></script>
		<script type="text/javascript" src="<c:url value="/scripts/js/json2.js"/>"></script>
	</head>
	<body>

<script type="text/javascript">  
 swfobject.embedSWF(   
	 "<c:url value="/open-flash-chart.swf"/>",    
     "my_chart",    
     "600",    
     "500",    
     "9.0.0",   
     "expressInstall.swf",   
     {"data-file":"<c:url value='/report/legalRiskOrientaionAnalysis/report.do?pointOfView=legalRisk'/>"},   
     {wmode:"transparent"}   
 );   
 </script>
	 <div id="my_chart"></div>
	</body>
</html>

   js 文件一定要引入正确,如果错误,将显示不了。如果想传多个参数,如下:将&改为%26

   

<script type="text/javascript">  
function onSelect(str){
     var ur = "<c:url value='/report/legalRiskOrientaionAnalysis/report.do?pointOfView=subject3%26legalSubjectId='/>"+str;
	 swfobject.embedSWF(   
		 "<c:url value="/open-flash-chart.swf"/>",    
	     "my_chart",    
	     "600",    
	     "500",    
	     "9.0.0",   
	     "expressInstall.swf",   
	     {"data-file":ur},   
	     {wmode:"transparent"}   
	 );   
}
 </script>

 

<action name="report" class="XXAction" method="report">
</action>

 

public String report() {
		String jsonReport = XX.xx();   //此处略
                     HttpServletResponse response = this.getResponse();
		response.setContentType("application/json-rpc;charset=utf-8");
		response.setHeader("Cache-Control", "no-cache");
		response.setHeader("Expires", "0");
		response.setHeader("Pragma", "No-cache");

		try {
			response.getWriter().print(jsonReport); // 写到客户端
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

 至于图形参考 http://hi.baidu.com/harbin_sakura/blog/item/74a5b5198bfb954e42a9ad5f.html 

  颜色 参考  : http://www.51toria.cn/demo/openflashchart/ofc.html

以上只为记录一下。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值