xinyb
2022-05-13 5b18c27a3a4fda518dc43ba88c6f79df7d38527e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.yc.sdk.shopping.util.SettingKey"%>    
<%
 String url_grid = SettingKey.getHostUrl(request) 
 + request.getContextPath() + "/";
 %>
<script type="text/javascript" src="/Grid/GridE.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/Grid/GridE.js")%>"></script>
<!-- 1. Add these JavaScript inclusions in the head of your page -->
<script type="text/javascript"
    src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
 
<script type="text/javascript" src="<%=url_grid %>/js/Highcharts/code/highcharts.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/Highcharts/code/highcharts.js")%>"></script>
<!-- 1b) Optional: the exporting module 
                <script type="text/javascript" src="<%=url_grid %>/js/Highcharts/code/modules/exporting.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/Highcharts/code/modules/exporting.js")%>"></script>-->
<!-- 2. Add the JavaScript to initialize the chart on document ready -->
<script type="text/javascript" src="<%=url_grid %>/js/chart38.js?v=<%=com.yc.utils.FileUtil.getVerstion(request,"/js/chart38.js")%>"></script>
<!-- 3. Add the JavaScript to initialize the chart on document ready -->
<style type="text/css">
.ul_p {
    float: left;
    height: 21px;
    _overflow: hidden;
    zoom: 1;
}
 
.ul_p li {
    float: left;
    width: 40px;
    height: 20px;
    text-align: center;
}
 
.check_p {
    float: left;
    width: 240px;
    height: 20px;
}
 
.show_div {
    width: 98%;
    height: 240px;
    border: 1px solid white;
    display: none;
    position: absolute;
}
 
.div_miaoshu {
    margin-top: 10px;
    width: 98%;
    height: 200px;
}
</style>
<script>
    function showDiv(th,showId){
         var topH=334;
          $('#'+showId).show();
          $('#'+showId).css('top',(parseInt($('#'+th).css('height'))+topH));
         var cor="#DEEDF7";
         $('#'+th).css('background',cor);
         $('#'+showId).css('background',cor)
    }
    function hideDiv(id,kId){
         $('#'+id).hide();
         $('#'+kId).css('background','#FFF');
    }
</script>
<!-- <div>
    <span style="margin-left: 5px;"><img
        src="/style/default/images/layout_button_down.gif"
        onclick="parent.goBack();" style="cursor: pointer;"></span><span
        style="margin-right: 5px; float: right;"><img
        src="/style/default/images/layout_button_down.gif"
        onclick="parent.goBack();" style="cursor: pointer;"></span>
</div> -->
<div>
<span style="margin-left: 10px;"><a onclick="parent.goBack();"  style="cursor: pointer;"><img
        src="/images/QQ20170511150152.png"
         style="cursor: pointer;">返回</a></span>
</div>
<div id="grap" style="width: 98%; height: 300px;"></div>
<div id="select_grap" style="font-size: 12px;">
    <ul id="char_p" class="ul_p">
        <li id="kongId" onmouseover="showDiv('kongId','tuDiv');"
            onmouseout="hideDiv('tuDiv','kongId');"><a
            href="javascript:void(0);">图型</a></li>
        <li id="kongIdx" onmouseover="showDiv('kongIdx','xDiv');"
            onmouseout="hideDiv('xDiv','kongIdx');"><a
            href="javascript:void(0);">X轴值</a></li>
        <li id="kongIdy" onmouseover="showDiv('kongIdy','yDiv');"
            onmouseout="hideDiv('yDiv','kongIdy');"><a
            href="javascript:void(0);">Y轴值</a></li>
        <li style="width: 50px;">对调<input type="checkbox" onclick="xy()"></li>
    </ul>
</div>
<div id="tuDiv" onmouseout="hideDiv('tuDiv','kongId');"
    onmouseover="showDiv('kongId','tuDiv');" class="show_div">
    <div class="div_miaoshu">
        <input type="radio" name="ptoType" onclick="charTo('line');"
            checked="checked">曲线 <input type="radio" name="ptoType"
            onclick="charTo('column');">条形分组 <input type="radio"
            name="ptoType" onclick="charTo('columnD');">条形叠加 <input
            type="radio" name="ptoType" onclick="charTo('pieD');">饼图叠加
    </div>
</div>
<div id="xDiv" onmouseout="hideDiv('xDiv','kongIdx');"
    onmouseover="showDiv('kongIdx','xDiv');" class="show_div">
    <div id="xKong" class="div_miaoshu"></div>
    <div style="width: 100%; float: left;">说明:请勾单选框的值为字符串的,此值作为X轴描述用,顾选择字符串值的字段才能实现画图的描述信息。</div>
</div>
<div id="yDiv" onmouseout="hideDiv('yDiv','kongIdy');"
    onmouseover="showDiv('kongIdy','yDiv');" class="show_div">
    <div id="yKong" class="div_miaoshu"></div>
    <div style="width: 100%; float: left;">说明:请勾复选框的值为数据的,才能实现画图的依据。</div>
</div>
<div id="grid_container" style="width: 98%; height: 36%;"></div>
<script>
    parent.mygrid=TreeGrid("${data}","grid_container");
    document.onkeydown = parent.hotkey;
    var grapht=${JSdata};<%//图表数据集数组,调用形式:grapht[0].Companyname%>
    var dataX="${dataX}";<%// int类型字段%>
    var dataY="${dataY}";<%// String类型字段%>
    function charTo(type){
           parameter.type=type;
           draw(grapht);
      }   
    function xMiaoTo(id){
        parameter.showId=id;
        draw(grapht);
    }
    function xy(){
        parameter.die=!parameter.die;
        draw(grapht);
    }
    function yValueTo(checsName){
        var checks=document.getElementsByName(checsName);
        var v;var j=0;
        parameter.vs=[];
        for(i=0;i<checks.length;i++){
            if(checks[i].checked){
                v=checks[i].value.split(";");
                parameter.vs[j]={};
                parameter.vs[j].drawId=v[0];
                parameter.vs[j].drawM=v[1];
                j++;
            }
        }
        draw(grapht);
    }
    (function(){
        var showSelct=function(){
            var fenge="&#039;";//"|"
            var datalist=(parent.document.getElementById('datalist').value).split(fenge);
            var selHtml="";var option="";var opInfo;
            var checkOps="";
            var checked=""
            var toX_=true;
            var toY_=true;
            for(var i=0;i<datalist.length;i++){
                opInfo=datalist[i].split(",");
                if(dataX.indexOf(';'+opInfo[1]+';')!=-1){<%//如果不是 数字类型%>
                    //checked="";
                    if(toY_){<%//并且是第一个数字 作为画图%>
                        var i_=0;
                        parameter.vs[i_]={};
                        parameter.vs[i_].drawM=opInfo[3];
                        parameter.vs[i_].drawId=opInfo[1];                        
                        toY_=false;
                    }
                    checked="checked";
                    checkOps+="<span class='check_p'><input type='checkbox' value='"+opInfo[1]+";"+opInfo[3]+"' name='checkVas' onclick=\"yValueTo('checkVas')\" "+checked+">"+opInfo[3]+"</span>";
                }else{
                    if(toX_){<%//并且是第一个 显示为描述%>
    parameter.showId = opInfo[1];
                        toX_ = false;
                    }
                    option += "<span class='check_p'><input type='radio' name='char_x_value' onclick=\"xMiaoTo('"
                            + opInfo[1]
                            + "');\" "
                            + ((i == 0) ? "checked" : "")
                            + ">"
                            + opInfo[3]
                            + "</span>";
                }
            }
            $('#xKong').html(option);
            $('#yKong').html(checkOps);
        }
        showSelct();
        parameter.type = "line";
        draw(grapht);
        yValueTo('checkVas');
    })();
</script>