数字位置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;
color:#ffffff;
position: relative;
top: 2.2%;
left: 35%;
top: 2.45%;
left: 33%;
font-size: 24px;
}
/* #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/dashboard.css">
<script src="${pageContext.request.contextPath}/static/pages/scripts/dashboard.js"></script>
<!--[if lt IE 9]>
<script src="js/html5shiv.min.js"></script>
<script src="js/respond.min.js"></script>
@@ -265,6 +264,17 @@
top: 5%;
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{
position: absolute;
@@ -344,8 +354,8 @@
<!-- 数据流出 -->
<div style="margin-left: -187px;margin-top: 11%;">
<div id="linesFlow_chu" style="height: 260px;"></div>
</div>
<div id="dataNums" ></div>
</div><div id="dataNums" ></div>
<div id="dataNumsStr"></div>
</div>
<div class="col-sm-3" style="height: 100%">
<div class="box_log_bar">
@@ -859,6 +869,7 @@
},
grid:{
left: 53,
top: '35%',
},
xAxis: {
type: 'time',
@@ -875,7 +886,7 @@
color: '#fff',
fontSize: 12,
formatter: function(value) {
return echarts.format.formatTime('hh:mm:ss', new Date(value));
return echarts.format.formatTime('hh:mm', new Date(value));
}
},
splitLine: {
@@ -885,6 +896,10 @@
},
yAxis: [{
type: 'value',
name: 'Bps',
nameTextStyle:{
color:'#ffffff',
},
min: 0,
axisLine: {
lineStyle: {
@@ -897,14 +912,20 @@
color: 'white',
fontSize: 12,
formatter: function (value, index) {
if (value > 1000 && value <= 1000000) {
return value/1000 + " K";
if (value > 1024 && value <= 1048576) {
return Math.round(value/1024) + " K";//Bps
}
if (value > 10000000 && value <= 1000000000) {
return value/1000000 + " M";
if (value > 1048576 && value <= 1073741824) {
return Math.round(value/1048576) + " M";//Bps
}
if (value > 100000000) {
return value/1000000000 + " B";
if (value > 1073741824 && value <= 1099511627776) {
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;
}
@@ -1044,16 +1065,19 @@
},
axisLabel: {
formatter: function(value) {
if (value > 1000 && value <= 1000000) {
return value/1000 + " K";
}
if (value > 10000000 && value <= 1000000000) {
return value/1000000 + " M";
}
if (value > 100000000) {
return value/1000000000 + " B";
}
return value;
if (value > 1000 && value <= 1000000) {
return Math.round(value/1000) + " K";
}
if (value > 1000000 && value <= 1000000000) {
return Math.round(value/1000000) + " M";
}
if (value > 1000000000 && value <= 1000000000000) {
return Math.round(value/1000000000) + " T";
}
if (value > 1000000000000) {
return Math.round(value/1000000000000) + " P";
}
return value;
},
},
splitNumber: 4,
@@ -1136,7 +1160,7 @@
$.ajax({
type:'get',
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){//处理返回结果
if(res) {
data = res;
@@ -1189,7 +1213,7 @@
$.ajax({
type:'get',
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){//处理返回结果
logData = res;
_logData = logData.shift();
@@ -1219,10 +1243,39 @@
/* 数字特效 */
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({
deVal:dropNum
});
$("#dataNumsStr").html("<span>"+unitStr+"</span>");//alert(unitStr);
};
function rand(min,max) {
@@ -1240,7 +1293,7 @@
$.ajax({
type:'get',
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){//处理返回结果
if(res) {
dropData = res;