| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676 |
- $(function () {
- // var whdef = 100/1920;// 表示1920的设计图,使用100PX的默认值
- var whdef = 100/916;// 表示1920的设计图,使用100PX的默认值
- var wH = window.innerHeight;// 当前窗口的高度
- var wW = window.innerWidth;// 当前窗口的宽度
- // var rem = wW * whdef;// 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
- var rem = wH * whdef;// 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
- $('html').css('font-size', rem + "px");
- loadoOption_ec_lefttop();
- loadoOption_ec_righttop();
- loadoOption_ec_rightbtm();
- loadoOption_ec_leftbtm();
- }) ;
- function loadoOption_ec_rightbtm(){
- ec_rightbtm.clear();
- var option = {
- title: {
- // text: '空调补水器压力监测',
- show: true,
- textStyle: {
- fontWeight: 'normal',
- fontSize: 22,
- color: '#3db3cb'
- },
- left: '2%',
- top: '2%'
- },
- tooltip: {
- trigger: 'axis',
- formatter: function(params) {
- var result = '';
- result+= params[0].axisValue+"</br>";
- params.forEach(function (item) {
- result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
- });
- return result;
- },
- // "{b}<br/>{a}: {c}MPa",
- extraCssText:'width:180px;',
- position: function (point, params, dom, rect, size) {
- // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
- // 提示框位置
- var x = 0; // x坐标位置
- var y = 0; // y坐标位置
-
- // 当前鼠标位置
- var pointX = point[0];
- var pointY = point[1];
-
- // 外层div大小
- // var viewWidth = size.viewSize[0];
- // var viewHeight = size.viewSize[1];
-
- // 提示框大小
- var boxWidth = size.contentSize[0];
- var boxHeight = size.contentSize[1];
-
- // boxWidth > pointX 说明鼠标左边放不下提示框
- if (boxWidth > pointX) {
- x = 5;
- } else { // 左边放的下
- x = pointX - boxWidth;
- }
-
- // boxHeight > pointY 说明鼠标上边放不下提示框
- if (boxHeight > pointY) {
- y = 5;
- } else { // 上边放得下
- y = pointY - boxHeight;
- }
-
- return [x, y];
- }
- },
-
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {
- lineStyle: {
- color: 'rgba(128, 128, 128, 0.5)'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#999'
- }
- },
- data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
- }],
- yAxis: [{
- type: 'value',
- name: '',
- axisTick: {
- show: false
- },
- axisLine: {
- show:false,
- lineStyle: {
- color: '#fff'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#799dff'
- }
- },
- min: function(value) {
- return Math.round(value.min - 10);
- },
- max: function(value) {
- return Math.round(value.min + 10);
- },
-
- splitLine: {
- lineStyle: {
- type: 'dashed',
- color: 'rgba(121, 157, 255, 0.5)'
- }
- }
- }],
- series: [{
- name: '空调补水器',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 15,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 3
- }
- },
- markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'},
- ],
- },
- markLine : {
- data : [
- {type : 'average', name: '平均值'},
- ]
- },
- data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
- }]
- }
- ec_rightbtm.setOption(option);
- }
- function loadoOption_ec_leftbtm(){
- ec_leftbtm.clear();
- var option = {
- title: {
- //text: '生活水泵压力监测',
- show: true,
- textStyle: {
- fontWeight: 'normal',
- fontSize: 22,
- color: '#3db3cb'
- },
- left: '2%',
- top: '2%'
- },
- tooltip: {
- trigger: 'axis',
- formatter: function(params) {
- var result = '';
- result+= params[0].axisValue+"</br>";
- params.forEach(function (item) {
- result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
- });
- return result;
- },
- // "{b}<br/>{a0}: {c0}MPa<br/>{a1}: {c1}MPa<br/>{a2}: {c2}MPa",
- extraCssText:'width:180px;',
- position: function (point, params, dom, rect, size) {
- // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
- // 提示框位置
- var x = 0; // x坐标位置
- var y = 0; // y坐标位置
-
- // 当前鼠标位置
- var pointX = point[0];
- var pointY = point[1];
-
- // 外层div大小
- // var viewWidth = size.viewSize[0];
- // var viewHeight = size.viewSize[1];
-
- // 提示框大小
- var boxWidth = size.contentSize[0];
- var boxHeight = size.contentSize[1];
-
- // boxWidth > pointX 说明鼠标左边放不下提示框
- if (boxWidth > pointX) {
- x = 5;
- } else { // 左边放的下
- x = pointX - boxWidth;
- }
-
- // boxHeight > pointY 说明鼠标上边放不下提示框
- if (boxHeight > pointY) {
- y = 5;
- } else { // 上边放得下
- y = pointY - boxHeight;
- }
-
- return [x, y];
- }
- },
- legend: {
- data:['生活水泵1','生活水泵2','生活水泵3'],
- textStyle: {
- fontSize: 14,
- color: '#799dff'
- }
- },
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {
- lineStyle: {
- color: 'rgba(128, 128, 128, 0.5)'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#999'
- }
- },
- data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
- }],
- yAxis: [{
- type: 'value',
- name: '',
- axisTick: {
- show: false
- },
- axisLine: {
- show:false,
- lineStyle: {
- color: '#fff'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#799dff'
- }
- },
- min: function(value) {
- return Math.round(value.min - 10);
- },
- max: function(value) {
- return Math.round(value.min + 10);
- },
-
- splitLine: {
- lineStyle: {
- type: 'dashed',
- color: 'rgba(121, 157, 255, 0.5)'
- }
- }
- }],
- series: [{
- name: '生活水泵1',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 15,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 3
- }
- },
- markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'}
- ]
- },
- markLine : {
- data : [
- {type : 'average', name: '平均值'},
- ],
- symbolOffset:[0,0]
- },
- data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
- },
- {
- name: '生活水泵2',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 15,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 3
- }
- },
- markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'}
- ],
- symbolOffset:[0,-40]
- },
- markLine : {
- data : [
- {type : 'average', name: '平均值'},
- ]
- },
- data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
- },
- {
- name: '生活水泵3',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 15,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 3
- }
- },
- markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'}
- ],
- symbolOffset:[0,-80]
- },
- markLine : {
- data : [
- {type : 'average', name: '平均值'},
- ]
- },
- data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
- },
- ]
- }
- ec_leftbtm.setOption(option);
- }
- function loadoOption_ec_righttop(){
- ec_righttop.clear();
- var option = {
- title: {
- // text: '消防备泵压力监测',
- show: true,
- textStyle: {
- fontWeight: 'normal',
- fontSize: 22,
- color: '#3db3cb'
- },
- left: '2%',
- top: '2%'
- },
- tooltip: {
- trigger: 'axis',
- formatter: function(params) {
- var result = '';
- result+= params[0].axisValue+"</br>";
- params.forEach(function (item) {
- result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
- });
- return result;
- },
- // "{b}<br/>{a}: {c}MPa",
- extraCssText:'width:180px;',
- position: function (point, params, dom, rect, size) {
- // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
- // 提示框位置
- var x = 0; // x坐标位置
- var y = 0; // y坐标位置
-
- // 当前鼠标位置
- var pointX = point[0];
- var pointY = point[1];
-
- // 外层div大小
- // var viewWidth = size.viewSize[0];
- // var viewHeight = size.viewSize[1];
-
- // 提示框大小
- var boxWidth = size.contentSize[0];
- var boxHeight = size.contentSize[1];
-
- // boxWidth > pointX 说明鼠标左边放不下提示框
- if (boxWidth > pointX) {
- x = 5;
- } else { // 左边放的下
- x = pointX - boxWidth;
- }
-
- // boxHeight > pointY 说明鼠标上边放不下提示框
- if (boxHeight > pointY) {
- y = 5;
- } else { // 上边放得下
- y = pointY - boxHeight;
- }
-
- return [x, y];
- }
- },
-
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {
- lineStyle: {
- color: 'rgba(128, 128, 128, 0.5)'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#999'
- }
- },
- data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
- }],
- yAxis: [{
- type: 'value',
- name: '',
- axisTick: {
- show: false
- },
- axisLine: {
- show:false,
- lineStyle: {
- color: '#fff'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#799dff'
- }
- },
- min: function(value) {
- return Math.round(value.min - 10);
- },
- max: function(value) {
- return Math.round(value.min + 10);
- },
-
- splitLine: {
- lineStyle: {
- type: 'dashed',
- color: 'rgba(121, 157, 255, 0.5)'
- }
- }
- }],
- series: [{
- name: '消防备泵压力',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 15,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 3
- }
- },
- markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'}
- ]
- },
- markLine : {
- data : [
- {type : 'average', name: '平均值'},
- ]
- },
- data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
- }]
- }
- ec_righttop.setOption(option);
- }
- function loadoOption_ec_lefttop(){
- ec_lefttop.clear();
- var option = {
- title: {
- // text: '消防主泵压力监测',
- show: true,
- textStyle: {
- fontWeight: 'normal',
- fontSize: 22,
- color: '#3db3cb'
- },
- left: '2%',
- top: '2%'
- },
- tooltip: {
- trigger: 'axis',
- formatter: function(params) {
- var result = '';
- result+= params[0].axisValue+"</br>";
- params.forEach(function (item) {
- result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
- });
- return result;
- },
- // "{b}<br/>{a}: {c}MPa",
- extraCssText:'width:180px;',
- position: function (point, params, dom, rect, size) {
- // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
- // 提示框位置
- var x = 0; // x坐标位置
- var y = 0; // y坐标位置
-
- // 当前鼠标位置
- var pointX = point[0];
- var pointY = point[1];
-
- // 外层div大小
- // var viewWidth = size.viewSize[0];
- // var viewHeight = size.viewSize[1];
-
- // 提示框大小
- var boxWidth = size.contentSize[0];
- var boxHeight = size.contentSize[1];
-
- // boxWidth > pointX 说明鼠标左边放不下提示框
- if (boxWidth > pointX) {
- x = 5;
- } else { // 左边放的下
- x = pointX - boxWidth;
- }
-
- // boxHeight > pointY 说明鼠标上边放不下提示框
- if (boxHeight > pointY) {
- y = 5;
- } else { // 上边放得下
- y = pointY - boxHeight;
- }
-
- return [x, y];
- }
- },
-
- grid: {
- left: '3%',
- right: '4%',
- bottom: '3%',
- containLabel: true
- },
- xAxis: [{
- type: 'category',
- boundaryGap: false,
- axisLine: {
- lineStyle: {
- color: 'rgba(128, 128, 128, 0.5)'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#999'
- }
- },
- data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
- }],
- yAxis: [{
- type: 'value',
- name: '',
- axisTick: {
- show: false
- },
- axisLine: {
- show:false,
- lineStyle: {
- color: '#fff'
- }
- },
- axisLabel: {
- margin: 10,
- textStyle: {
- fontSize: 14,
- color: '#799dff'
- }
- },
- min: function(value) {
- return Math.round(value.min - 10);
- },
- max: function(value) {
- return Math.round(value.min + 10);
- },
-
- splitLine: {
- lineStyle: {
- type: 'dashed',
- color: 'rgba(121, 157, 255, 0.5)'
- }
- }
- }],
- series: [{
- name: '消防主泵',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 15,
- showSymbol: true,
- lineStyle: {
- normal: {
- width: 3
- }
- },
- markPoint : {
- data : [
- {type : 'max', name: '最大值'},
- {type : 'min', name: '最小值'}
- ]
- },
- markLine : {
- data : [
- {type : 'average', name: '平均值'},
- ]
- },
- data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
- }]
- }
- ec_lefttop.setOption(option);
- }
|