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

9 篇文章 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>


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ithouse

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值