zoukankan      html  css  js  c++  java
  • FusionChart实现漏斗图

    1、提供静态数据源XML

    Funnel.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <chart manageResize="1" caption="2012年月平均统计人数" subcaption="千" decimals="1" 
           baseFontSize="12" useSameSlantAngle="1" isHollow="1" formatNumberScale="1" 
           numberPrefix="$">
       <set label="一月" value="38563" />
       <set label="二月" value="23563" />
       <set label="三月" value="84564" />
       <set label="四月" value="45654" />
       <set label="五月" value="36342" />
       <set label="六月" value="38563" />
       <set label="七月" value="27563" />
       <set label="八月" value="84564" />
       <set label="九月" value="35654" />
       <set label="十月" value="58342" />
       <set label="十一月" value="35654" />
       <set label="十二月" value="48342" />
    </chart>

    2、源码如下

    Funnel.jsp:

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>FusionChart实现漏斗图</title>
    <script type="text/javascript" src="../Scripts/JS/jquery-1.10.2.js"></script>
    <script type="text/javascript" src="../Chart/JS/FusionCharts.js"></script>
    <style type="text/css">
        body{
           100%;
          height: 100%;
          font-size: 12px;
        }
        div{
           100%;
          height: 100%;
        }
    </style>
    <script type="text/javascript">
        $(function(){
        	 //利用XML提供的静态数据来作为数据源
    	   	 var Funnel = new FusionCharts( "../Chart/SWF/Funnel.swf", "FunnelId", "98%", "600", "0", "1" );
    	   	 Funnel.setXMLUrl("xml/Funnel.xml");
    	   	 Funnel.render("Funnel3D");
        });
    </script>
    </head>
    <body>
       <div id="Funnel3D"></div>
    </body>
    </html>

    3、运行结果(如图)

    (1)初始化


    (2)修改了isHollow="1"


  • 相关阅读:
    PHP header函数设置http报文头示例详解
    在Windows下为PHP安装redis扩展
    CMD模拟http请求
    strstr使用
    memset使用
    QT修改应用程序图标
    纪念下自学QT 第十天 终于写成了串口调试助手
    QT设置textEdit光标到末尾
    QT设置TextEdit颜色
    QT设置QToolBar带有图标和文字
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13315665.html
Copyright © 2011-2022 走看看