stateGraphs.jsp
1.57 KB
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
<%@ page session="false" language="java" pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:useBean id="model" type="com.dianping.cat.report.page.state.Model" scope="request" />
<jsp:useBean id="payload" type="com.dianping.cat.report.page.state.Payload" scope="request" />
<style type="text/css">
.graph {
width: 100%;
height: 400px;
}
</style>
<script type="text/javascript" src="/cat/js/jquery-1.7.1.js"></script>
<script type="text/javascript" src="/cat/js/highcharts.js"></script>
<script type="text/javascript" src="/cat/js/baseGraph.js"></script>
<c:choose>
<c:when test="${payload.ipAddress eq 'All' and payload.key ne 'delayAvg'}">
<table width=100%>
<tr>
<td width="50%"><div id="trendGraph" class="graph"></div></td>
<td width="50%"><div id="distributionChart" class="graph"></div></td>
</tr>
<tr>
<td style="display:none">
<div id ="trendMeta">${model.graph}</div>
</td>
<td>
<div id ="distributionMeta" style="display:none">${model.pieChart}</div>
</td></tr>
</table>
</c:when>
<c:otherwise>
<table width=50%>
<tr>
<td><div id="trendGraph" class="graph"></div></td>
</tr>
<tr>
<td style="display:none">
<div id ="trendMeta">${model.graph}</div>
</td>
</tr>
</table>
</c:otherwise>
</c:choose>
<script type="text/javascript">
var data = ${model.graph};
graphLineChart(document.getElementById('trendGraph'), data);
data = ${model.pieChart};
if (data != null && data.length > 0) {
graphPieChart($('#distributionChart', cell)[0], eval('(' + data + ')'));
}
</script>