diff options
| author | 段冬梅 <[email protected]> | 2018-12-12 17:21:59 +0800 |
|---|---|---|
| committer | 段冬梅 <[email protected]> | 2018-12-12 17:21:59 +0800 |
| commit | 89847352be1b2f13c3d9b401897f95a2f953a664 (patch) | |
| tree | 59f7c6fb924136bdb7d882d28af8c8d3ae4a6d74 | |
| parent | e8f6aca4cf28c15b0fea867ddb5cdd94398c517c (diff) | |
修改 流量统计时间格式 ,区域图改成折线图
3 files changed, 133 insertions, 119 deletions
diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp index 34f2f7c..96c7dce 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficActionTransList.jsp @@ -1,110 +1,124 @@ -<%@ page contentType="text/html;charset=UTF-8"%> -<%@ include file="/WEB-INF/include/taglib.jsp"%> -<html> -<head> -<title> - <spring:message code="traffic_ip_active"></spring:message> -</title> -</head> - -<body> - -<div class="page-content"> - <div class="theme-panel hidden-xs hidden-sm"> - <button type="button" class="btn btn-default" onClick="javascript:window.location.reload()"><i class="fa fa-refresh"></i></button> - <button type="button" class="btn btn-default" onClick="javascript:window.location='${ctx}/dashboard/logChart'"><i class="fa fa-history"></i></button> - </div> - <h3 class="page-title"> - <spring:message code="${searchAction}"></spring:message> - </h3> - - <div id="chart" style="width:97%;height:550px;"></div> - - <input id="searchAction" name="searchAction" type="hidden" value="${searchAction}"/> - -</div> -<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script> -<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script> -<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script> -<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script> -<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%> -<script type="text/javascript"> -$(document).ready(function(){ - actionTransAjax($("#searchAction").val()); -}); -// 局点信息 -function showActionTransChart(rs){ - var data=new Array(); - var xData=new Array(); - xData=rs[0].statTime; - var series=new Array(); - $(rs).each(function(i, d) { - var entrance=""; - if(d!=null&&d.entranceId==1){ - entrance="Astana"; - } - if(d!=null&&d.entranceId==2){ - entrance="Alamty"; - } - series.push({ - name: entrance, - data: d.count - }); - }) - var chart = Highcharts.chart('chart', { - exporting: { - filename:'Action-Trans', - scale:1, - sourceWidth: 1280, - sourceHeight: 500, - }, - title: { - text: null - }, - xAxis: { - type:'category', - categories: xData, - title: { - text: 'time', - align:'high', - }, - }, - yAxis: { - title: { - text: null - } - }, - credits:{//是否有highcharts水印 - enabled:false - }, -// legend: { -// layout: 'vertical', -// align: 'right', -// verticalAlign: 'middle' -// }, - series: series, - }); -} - // 动作一小时,间隔五分钟统计数据 - function actionTransAjax(searchAction){ - loading(); - $.ajax({ - url: "${ctx}/dashboard/traffic/actionEntranceTrans?searchAction="+searchAction, - type : "get" , - dataType:"json", - cache:false, - async:true, - success:function (rs) { - showActionTransChart(rs); - closeTip(); - }, - error: function(data, textStatus, errorThrown){ - closeTip(); - }, - - }); - - } -</script> -</body> +<%@ page contentType="text/html;charset=UTF-8"%>
+<%@ include file="/WEB-INF/include/taglib.jsp"%>
+<html>
+<head>
+<title>
+ <spring:message code="traffic_ip_active"></spring:message>
+</title>
+</head>
+
+<body>
+
+<div class="page-content">
+ <div class="theme-panel hidden-xs hidden-sm">
+ <button type="button" class="btn btn-default" onClick="javascript:window.location.reload()"><i class="fa fa-refresh"></i></button>
+ <button type="button" class="btn btn-default" onClick="javascript:window.location='${ctx}/dashboard/logChart'"><i class="fa fa-history"></i></button>
+ </div>
+ <h3 class="page-title">
+ <spring:message code="${searchAction}"></spring:message>
+ </h3>
+
+ <div id="chart" style="width:97%;height:550px;"></div>
+
+ <input id="searchAction" name="searchAction" type="hidden" value="${searchAction}"/>
+
+</div>
+<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
+<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
+<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
+<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
+<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
+<script type="text/javascript">
+$(document).ready(function(){
+ actionTransAjax($("#searchAction").val());
+});
+// 局点信息
+function showActionTransChart(rs){
+ var data=new Array();
+ var xData=new Array();
+ xData=rs[0].statTime;
+ var series=new Array();
+ $(rs).each(function(i, d) {
+ var entrance="";
+ if(d!=null&&d.entranceId==1){
+ entrance="Astana";
+ }
+ if(d!=null&&d.entranceId==2){
+ entrance="Alamty";
+ }
+ series.push({
+ name: entrance,
+ data: d.count
+ });
+ })
+ var chart = Highcharts.chart('chart', {
+ /* chart:{
+ type: 'area',
+ }, */
+ exporting: {
+ filename:'Action-Trans',
+ scale:1,
+ sourceWidth: 1280,
+ sourceHeight: 500,
+ },
+ title: {
+ text: null
+ },
+ xAxis: {
+ type:'category',
+ categories: xData,
+ title: {
+ text: 'time',
+ align:'high',
+ },
+ },
+ yAxis: {
+ title: {
+ text: null
+ }
+ },
+ credits:{//是否有highcharts水印
+ enabled:false
+ },
+ /* plotOptions: {
+ area: {
+ stacking: 'normal',
+ lineColor: '#666666',
+ lineWidth: 1,
+ marker: {
+ lineWidth: 1,
+ lineColor: '#666666'
+ }
+ }
+ }, */
+// legend: {
+// layout: 'vertical',
+// align: 'right',
+// verticalAlign: 'middle'
+// },
+ series: series,
+ });
+}
+ // 动作一小时,间隔五分钟统计数据
+ function actionTransAjax(searchAction){
+ loading();
+ $.ajax({
+ url: "${ctx}/dashboard/traffic/actionEntranceTrans?searchAction="+searchAction,
+ type : "get" ,
+ dataType:"json",
+ cache:false,
+ async:true,
+ success:function (rs) {
+ showActionTransChart(rs);
+ closeTip();
+ },
+ error: function(data, textStatus, errorThrown){
+ closeTip();
+ },
+
+ });
+
+ }
+</script>
+</body>
</html>
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp index d1619d5..58dd5da 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp @@ -112,6 +112,7 @@ $(document).ready(function(){ });
function searchList(){
+ loading();
var start=$("#beginDate").val();
var end=$("#endDate").val();
changeBandwidth($("#unitType").val(),start,end);
@@ -259,7 +260,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ var chart = Highcharts.chart(id, {
chart:{
- type: 'area',
+// type: 'area',
zoomType: 'x'
},
title: {
@@ -281,7 +282,6 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ title: {
text: unitType
},
- tickmarkPlacement: 'on',
min:0
},
legend: {
@@ -289,10 +289,10 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ },
xAxis:{
type: 'datetime',
- tickmarkPlacement: 'on',
+// tickmarkPlacement: 'on',
dateTimeLabelFormats: {
millisecond: '%H:%M:%S.%L',
- second: '%H:%M:%S',
+ second: '%H:%M',
minute: '%H:%M',
hour: '%H:%M',
day: '%m-%d',
@@ -309,7 +309,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ credits:{//是否有highcharts水印
enabled:false
},
- plotOptions: {
+ /* plotOptions: {
area: {
stacking: 'normal',
lineColor: '#666666',
@@ -319,7 +319,7 @@ function showBandwidthChart(id,unitType,xdata,ydata,title){ lineColor: '#666666'
}
}
- },
+ }, */
series: ydata,
});
diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp index 904dee4..6594696 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficIpActiveList.jsp @@ -105,9 +105,9 @@ function showIpActiveChart(rs){ });
})
var chart = Highcharts.chart('chart', {
- chart:{
+ /* chart:{
type: 'area',
- },
+ }, */
exporting: {
filename:'IP-Active',
scale:1,
@@ -124,7 +124,7 @@ function showIpActiveChart(rs){ text: 'time',
align:'high',
},
- plotOptions: {
+ /* plotOptions: {
area: {
stacking: 'normal',
lineColor: '#666666',
@@ -134,7 +134,7 @@ function showIpActiveChart(rs){ lineColor: '#666666'
}
}
- },
+ }, */
// labels:{
// formatter:function(){
// if(this.value.length>15){
|
