FusionCharts 实现统计图
1 .将fusionChart.jar 解压后的文件放入项目中
2.在jsp页面导入
<script src="<%=request.getContextPath()%>/FusionCharts/Charts/FusionCharts.js" type="text/javascript"></script>
3.jsp页面
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags" %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> </head> <body> <s:hidden id="xmldataString" name="xmldataString"/> <%@ include file="template/resource.jsp" %> <div > <div id="chartContainer" style="position:absolute; left :100px "> 柱状图测试 </div> <script type="text/javascript" > var xmldataString=$("#xmldataString").val(); // alert(xmldataString); var myChart = new FusionCharts( "FusionCharts/Charts/Column3D.swf","myChartId", "800", "350", "0", "1" ); //myChart.setXMLUrl("testxml.xml"); myChart.setDataXML(xmldataString); myChart.render("chartContainer"); //showCharts(xml); </script> </div> </body> </html>
4.提供数据
package com.gaeainfo.toponymbase.util; import java.util.HashMap; import java.util.List; import java.util.Map; import org.dom4j.Document; import org.dom4j.DocumentHelper; import org.dom4j.Element; import com.gaeainfo.toponymbase.pojo.ChangeStatisticsObject; import com.gaeainfo.toponymbase.pojo.ConsultStatisticsObject; /** * * * 统计图的xml数据 */ public class GetXmlData { //这里根据需要封装你需要的xml 返回给前台 }
相关推荐
Tonybo 2016-11-17
frontworld 2016-11-15
飞天喜欢你 2017-06-30
frontworld 2016-11-17
石山下 2016-11-15
MusicPeng 2012-06-13
atpsoul 2012-03-16
feifei000 2014-02-12
qsx00 2019-03-15
huakai 2017-06-21
没有学不好的技术 2018-07-04
yaasshole 2019-04-19
PHP100 2019-03-28
PHP100 2019-03-28
PHP100 2019-03-27
BitTigerio 2018-02-17
前端外刊评论 2018-01-03