• FusionChart实现金字塔分布图


    1、XML提供数据源

    Pyramid.xml:

    <?xml version="1.0" encoding="UTF-8"?>
    <chart manageresize="1" animation="0" decimals="0" caption="一周分布人数" baseFontSize="18"
           showpercentvalues="1" smartlinecolor="333333" showborder="0" showtooltipshadow="1" >
    	<set value="48940" label="星期一" />
    	<set value="67845" label="星期二" />
    	<set value="50421" label="星期三" />
    	<set value="27850" label="星期四" />
    	<set value="40121" label="星期五" />
    	<set value="78455" label="星期六" />
    	<set value="56454" label="星期日" />
    </chart>

    2、页面源码

    Pyramid.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>
    <script type="text/javascript">
        $(function(){
        	 var pyramid = new FusionCharts( "../Chart/SWF/Pyramid.swf", "pyramidId", "1280", "550", "0" );
        	 pyramid.setXMLUrl("xml/Pyramid.xml");
        	 pyramid.render("Pyramid");
        });
    </script>
    </head>
    <body>
       <div id="Pyramid"></div>
    </body>
    </html>

    3、运行结果如下:


  • 相关阅读:
    操作winrar
    lucene.NET详细使用与优化详解
    js实现记住帐号或密码(js读写COOKIE)
    jQuery对select操作小结
    XMLHelper
    AJAX2用法
    as3Crypto and php, what a fun ride!
    linux文件描述符导致squid拒绝服务
    Centos 增加硬盘
    安装Squid log analyzer分析工具
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13315670.html
Copyright © 2020-2023  润新知