首页 > 其他 > 详细

在一个页面显示多个iChart报表

时间:2014-08-15 18:00:19      阅读:242      评论:0      收藏:0      [点我收藏+]
<%@ page language="java" pageEncoding="UTF-8"
         contentType="text/html;charset=utf-8" isELIgnored="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<html>
    <head>
        <title>Project Report</title>
        <c:set var="baseUrl" value="${pageContext.request.contextPath}"/>
        <%--<link rel="stylesheet" href="../resources/css/bootstrap.min.css"/>
        <link rel="stylesheet" href="../resources/css/bootstrap-theme.min.css"/>--%>
        <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
        <script type="text/javascript" src="../resources/js/jquery/jquery-1.9.0.js"></script>
        <script type="text/javascript" src="../resources/js/ichart.1.2.min.js"></script>
        <script type="text/javascript" src="../resources/js/randomcolor.js"></script>
        <script type="text/javascript">

            $(function(){
                var defaultId = "${defaultSelected}";
                $("select option").each(function(){
                    if($(this).val()==defaultId){
                        $(this).attr("selected","selected");
                    }
                });
                //alert(defaultId);
                <c:forEach var="bntm" items="${buildNameTaskMap}">
                    <c:forEach var="bntmv" items="${bntm.value}">

                        var data = [
                            {
                                value:[${bntmv.value[0]}],
                                color:'#47AAB3'

                            },
                            {
                                value:[${bntmv.value[1]}],
                                color:'#ECAD55'
                            }
                        ];
                        var chart = new iChart.BarStacked2D({
                            render : 'canvasDiv${bntm.key}${bntmv.key}',
                            data: data,
                            width : 400,
                            height : 45,
                            bar_height:25,
                            shadow_blur : 2,
                            shadow_offsetx : 1,
                            shadow_offsety : 0,
                            border:0,
                            showpercent:true,
                            decimalsnum:0,
                            coordinate:{

                                scale:[{
                                    position:'bottom',
                                    scale_enable : false,
                                    start_scale:0,
                                    end_scale:${bntmv.value[2]},
                                    listeners:{
                                        parseText:function(t,x,y){
                                            return {text:+t}
                                        }
                                    }
                                }],
                                width:600,
                                height:40
                            }
                        });
                        chart.draw();

                    </c:forEach>
                </c:forEach>
            });
        </script>
    </head>
    <body>
        <div class="ui-page-head">
            <h2>
                Build Report
                   <a href="${baseUrl}/report/showReport.shtml"><img src="../resources/images/goback.png"></a>
            </h2>
        </div>
        <form action="${baseUrl}/report/buildReport.shtml">
            <span>Select a project:</span>
            <select name="selectedProId">
                <c:forEach items="${projectNameId}" var="pni">
                    <option value="${pni.value}">${pni.key}</option>
                </c:forEach>
            </select>
            <button type="submit" id="submit">search</button>
        </form><br/>

        <c:if test="${null ne buildNameTaskMap}">
            <table class="ui-table">
                <tr>
                    <th>Build Name</th>
                    <th>Task Name</th>
                    <th>Success Times</th>
                    <th>Failure Times</th>
                    <th>Total Times</th>
                    <th>Output Report</th>
                </tr>

                <c:forEach var="bntm" items="${buildNameTaskMap}">
                    <%--Build Name--%>
                    <tr>
                        <td rowspan="${bntm.value.size()+1}">
                                ${bntm.key}
                        </td>
                    </tr>
                    <c:forEach var="bntmv" items="${bntm.value}">
                        <tr>
                            <%--Task Name--%>
                            <td>${bntmv.key}</td>
                            <td>${bntmv.value[0]}</td>
                            <td>${bntmv.value[1]}</td>
                            <td>${bntmv.value[2]}</td>
                            <td><div id="canvasDiv${bntm.key}${bntmv.key}"></div></td>
                            <%--用一个for循环将所有的id都包括,在JS中传参。--%>
                        </tr>
                    </c:forEach>
                </c:forEach>
            </table>
        </c:if>
        <c:if test="${null eq buildNameTaskMap}">
            No Output.
        </c:if>
    </body>
</html>


 

在一个页面显示多个iChart报表,布布扣,bubuko.com

在一个页面显示多个iChart报表

原文:http://blog.csdn.net/ithouse/article/details/38586859

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!