数字位置1920*1080chrome位置合适;

数字位置1920*1080火狐位置有点偏;
数字位置1366*768笔记本火狐位置偏的比较明显;
This commit is contained in:
dongxiaoyan
2018-12-29 15:32:50 +08:00
parent 8cfc65f98c
commit 3c10bba36e
2 changed files with 79 additions and 26 deletions

View File

@@ -268,8 +268,8 @@
font-size:18px; font-size:18px;
color:#ffffff; color:#ffffff;
position: relative; position: relative;
top: 2.2%; top: 2.45%;
left: 35%; left: 33%;
font-size: 24px; font-size: 24px;
} }
/* #dataNumsStr span{ /* #dataNumsStr span{

View File

@@ -10,7 +10,6 @@
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/data_text.css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/data_text.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/dashboard.css"> <link rel="stylesheet" href="${pageContext.request.contextPath}/static/pages/css/dashboard.css">
<script src="${pageContext.request.contextPath}/static/pages/scripts/dashboard.js"></script> <script src="${pageContext.request.contextPath}/static/pages/scripts/dashboard.js"></script>
<!--[if lt IE 9]> <!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script> <script src="js/html5shiv.min.js"></script>
<script src="js/respond.min.js"></script> <script src="js/respond.min.js"></script>
@@ -265,6 +264,17 @@
top: 5%; top: 5%;
left: -41%; left: -41%;
} }
#dataNumsStr{
font-size:18px;
color:#ffffff;
position: relative;
top: 2.45%;
left: 33%;
font-size: 24px;
}
/* #dataNumsStr span{
margin-left:-45px;font-size:23px;font-family:arial;font-weight:bold;
} */
/* 杂质动态 */ /* 杂质动态 */
.zzdt{ .zzdt{
position: absolute; position: absolute;
@@ -344,8 +354,8 @@
<!-- 数据流出 --> <!-- 数据流出 -->
<div style="margin-left: -187px;margin-top: 11%;"> <div style="margin-left: -187px;margin-top: 11%;">
<div id="linesFlow_chu" style="height: 260px;"></div> <div id="linesFlow_chu" style="height: 260px;"></div>
</div> </div><div id="dataNums" ></div>
<div id="dataNums" ></div> <div id="dataNumsStr"></div>
</div> </div>
<div class="col-sm-3" style="height: 100%"> <div class="col-sm-3" style="height: 100%">
<div class="box_log_bar"> <div class="box_log_bar">
@@ -859,6 +869,7 @@
}, },
grid:{ grid:{
left: 53, left: 53,
top: '35%',
}, },
xAxis: { xAxis: {
type: 'time', type: 'time',
@@ -875,7 +886,7 @@
color: '#fff', color: '#fff',
fontSize: 12, fontSize: 12,
formatter: function(value) { formatter: function(value) {
return echarts.format.formatTime('hh:mm:ss', new Date(value)); return echarts.format.formatTime('hh:mm', new Date(value));
} }
}, },
splitLine: { splitLine: {
@@ -885,6 +896,10 @@
}, },
yAxis: [{ yAxis: [{
type: 'value', type: 'value',
name: 'Bps',
nameTextStyle:{
color:'#ffffff',
},
min: 0, min: 0,
axisLine: { axisLine: {
lineStyle: { lineStyle: {
@@ -897,14 +912,20 @@
color: 'white', color: 'white',
fontSize: 12, fontSize: 12,
formatter: function (value, index) { formatter: function (value, index) {
if (value > 1000 && value <= 1000000) { if (value > 1024 && value <= 1048576) {
return value/1000 + " K"; return Math.round(value/1024) + " K";//Bps
} }
if (value > 10000000 && value <= 1000000000) { if (value > 1048576 && value <= 1073741824) {
return value/1000000 + " M"; return Math.round(value/1048576) + " M";//Bps
} }
if (value > 100000000) { if (value > 1073741824 && value <= 1099511627776) {
return value/1000000000 + " B"; return Math.round(value/1073741824) + " G";//Bps
}
if (value > 1099511627776 && value <= 1125899906842624) {
return Math.round(value/1099511627776) + " T";//Bps
}
if (value > 1125899906842624) {
return Math.round(value/1125899906842624) + " P";//Bps
} }
return value; return value;
} }
@@ -1044,16 +1065,19 @@
}, },
axisLabel: { axisLabel: {
formatter: function(value) { formatter: function(value) {
if (value > 1000 && value <= 1000000) { if (value > 1000 && value <= 1000000) {
return value/1000 + " K"; return Math.round(value/1000) + " K";
} }
if (value > 10000000 && value <= 1000000000) { if (value > 1000000 && value <= 1000000000) {
return value/1000000 + " M"; return Math.round(value/1000000) + " M";
} }
if (value > 100000000) { if (value > 1000000000 && value <= 1000000000000) {
return value/1000000000 + " B"; return Math.round(value/1000000000) + " T";
} }
return value; if (value > 1000000000000) {
return Math.round(value/1000000000000) + " P";
}
return value;
}, },
}, },
splitNumber: 4, splitNumber: 4,
@@ -1136,7 +1160,7 @@
$.ajax({ $.ajax({
type:'get', type:'get',
dataType: 'json', dataType: 'json',
url:"${pageContext.request.contextPath}/nis/dynamicpage/indexTraffic?baseNum=" + top.baseNum, url:"${pageContext.request.contextPath}/nis/dynamicpage/indexTraffic?hour=2&baseNum=" + top.baseNum,
success:function(res){//处理返回结果 success:function(res){//处理返回结果
if(res) { if(res) {
data = res; data = res;
@@ -1189,7 +1213,7 @@
$.ajax({ $.ajax({
type:'get', type:'get',
dataType: 'json', dataType: 'json',
url:'${pageContext.request.contextPath}/nis/dynamicpage/indexLog?sid=' + top.indexLogServiceId + "&baseNum=" + top.baseNum, url:'${pageContext.request.contextPath}/nis/dynamicpage/indexLog?hour=24&sid=' + top.indexLogServiceId + "&baseNum=" + top.serviceBaseNum,
success:function(res){//处理返回结果 success:function(res){//处理返回结果
logData = res; logData = res;
_logData = logData.shift(); _logData = logData.shift();
@@ -1219,10 +1243,39 @@
/* 数字特效 */ /* 数字特效 */
function animalNum(dropNum){ function animalNum(dropNum){
//var value = rand(100,999);; var unitStr = "";
if (dropNum > 1000 && dropNum <= 1000000) {
dropNum = Math.round(dropNum/1000);//K取整
//dropNum = (dropNum/1000).toFixed(1);alert(dropNum);
unitStr = "K";
}
if (dropNum > 1000000 && dropNum <= 1000000000) {
dropNum = Math.round(dropNum/1000000);//M
//dropNum = (dropNum/1000000).toFixed(1);
unitStr = "M";
}
if (dropNum > 1000000000 && dropNum <= 1000000000000) {
dropNum = Math.round(dropNum/1000000000);//G
//dropNum = (dropNum/1000000000).toFixed(1);
unitStr = "G";
}
if (dropNum > 1000000000000 && dropNum <= 1000000000000000) {
dropNum = Math.round(dropNum/1000000000000);//T
//dropNum = (dropNum/1000000000000).toFixed(1);
unitStr = "T";
}
if (dropNum > 1000000000000000) {
dropNum = Math.round(dropNum/1000000000000000);//P
//dropNum = (dropNum/1000000000000000).toFixed(1);
unitStr = "P";
}
//dropNum = rand(100,999);
//dropNum= dropNum+"M";
$("#dataNums").empty();
$("#dataNums").rollNum({ $("#dataNums").rollNum({
deVal:dropNum deVal:dropNum
}); });
$("#dataNumsStr").html("<span>"+unitStr+"</span>");//alert(unitStr);
}; };
function rand(min,max) { function rand(min,max) {
@@ -1240,7 +1293,7 @@
$.ajax({ $.ajax({
type:'get', type:'get',
dataType: 'json', dataType: 'json',
url:'${pageContext.request.contextPath}/nis/dynamicpage/indexDrop' + "?baseNum=" + top.baseNum, url:'${pageContext.request.contextPath}/nis/dynamicpage/indexDrop?hour=24' + "&baseNum=" + top.dropBaseNum,
success:function(res){//处理返回结果 success:function(res){//处理返回结果
if(res) { if(res) {
dropData = res; dropData = res;