sensor_yali.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676
  1. $(function () {
  2. // var whdef = 100/1920;// 表示1920的设计图,使用100PX的默认值
  3. var whdef = 100/916;// 表示1920的设计图,使用100PX的默认值
  4. var wH = window.innerHeight;// 当前窗口的高度
  5. var wW = window.innerWidth;// 当前窗口的宽度
  6. // var rem = wW * whdef;// 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
  7. var rem = wH * whdef;// 以默认比例值乘以当前窗口宽度,得到该宽度下的相应FONT-SIZE值
  8. $('html').css('font-size', rem + "px");
  9. loadoOption_ec_lefttop();
  10. loadoOption_ec_righttop();
  11. loadoOption_ec_rightbtm();
  12. loadoOption_ec_leftbtm();
  13. }) ;
  14. function loadoOption_ec_rightbtm(){
  15. ec_rightbtm.clear();
  16. var option = {
  17. title: {
  18. // text: '空调补水器压力监测',
  19. show: true,
  20. textStyle: {
  21. fontWeight: 'normal',
  22. fontSize: 22,
  23. color: '#3db3cb'
  24. },
  25. left: '2%',
  26. top: '2%'
  27. },
  28. tooltip: {
  29. trigger: 'axis',
  30. formatter: function(params) {
  31.     var result = '';
  32. result+= params[0].axisValue+"</br>";
  33.     params.forEach(function (item) {
  34.         result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
  35.     });
  36.     return result;
  37. },
  38. // "{b}<br/>{a}: {c}MPa",
  39. extraCssText:'width:180px;',
  40. position: function (point, params, dom, rect, size) {
  41. // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
  42. // 提示框位置
  43. var x = 0; // x坐标位置
  44. var y = 0; // y坐标位置
  45. // 当前鼠标位置
  46. var pointX = point[0];
  47. var pointY = point[1];
  48. // 外层div大小
  49. // var viewWidth = size.viewSize[0];
  50. // var viewHeight = size.viewSize[1];
  51. // 提示框大小
  52. var boxWidth = size.contentSize[0];
  53. var boxHeight = size.contentSize[1];
  54. // boxWidth > pointX 说明鼠标左边放不下提示框
  55. if (boxWidth > pointX) {
  56. x = 5;
  57. } else { // 左边放的下
  58. x = pointX - boxWidth;
  59. }
  60. // boxHeight > pointY 说明鼠标上边放不下提示框
  61. if (boxHeight > pointY) {
  62. y = 5;
  63. } else { // 上边放得下
  64. y = pointY - boxHeight;
  65. }
  66. return [x, y];
  67. }
  68. },
  69. grid: {
  70. left: '3%',
  71. right: '4%',
  72. bottom: '3%',
  73. containLabel: true
  74. },
  75. xAxis: [{
  76. type: 'category',
  77. boundaryGap: false,
  78. axisLine: {
  79. lineStyle: {
  80. color: 'rgba(128, 128, 128, 0.5)'
  81. }
  82. },
  83. axisLabel: {
  84. margin: 10,
  85. textStyle: {
  86. fontSize: 14,
  87. color: '#999'
  88. }
  89. },
  90. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  91. }],
  92. yAxis: [{
  93. type: 'value',
  94. name: '',
  95. axisTick: {
  96. show: false
  97. },
  98. axisLine: {
  99. show:false,
  100. lineStyle: {
  101. color: '#fff'
  102. }
  103. },
  104. axisLabel: {
  105. margin: 10,
  106. textStyle: {
  107. fontSize: 14,
  108. color: '#799dff'
  109. }
  110. },
  111. min: function(value) {
  112. return Math.round(value.min - 10);
  113. },
  114. max: function(value) {
  115. return Math.round(value.min + 10);
  116. },
  117. splitLine: {
  118. lineStyle: {
  119. type: 'dashed',
  120. color: 'rgba(121, 157, 255, 0.5)'
  121. }
  122. }
  123. }],
  124. series: [{
  125. name: '空调补水器',
  126. type: 'line',
  127. smooth: true,
  128. symbol: 'circle',
  129. symbolSize: 15,
  130. showSymbol: true,
  131. lineStyle: {
  132. normal: {
  133. width: 3
  134. }
  135. },
  136. markPoint : {
  137. data : [
  138. {type : 'max', name: '最大值'},
  139. {type : 'min', name: '最小值'},
  140. ],
  141. },
  142. markLine : {
  143. data : [
  144. {type : 'average', name: '平均值'},
  145. ]
  146. },
  147. data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
  148. }]
  149. }
  150. ec_rightbtm.setOption(option);
  151. }
  152. function loadoOption_ec_leftbtm(){
  153. ec_leftbtm.clear();
  154. var option = {
  155. title: {
  156. //text: '生活水泵压力监测',
  157. show: true,
  158. textStyle: {
  159. fontWeight: 'normal',
  160. fontSize: 22,
  161. color: '#3db3cb'
  162. },
  163. left: '2%',
  164. top: '2%'
  165. },
  166. tooltip: {
  167. trigger: 'axis',
  168. formatter: function(params) {
  169.     var result = '';
  170. result+= params[0].axisValue+"</br>";
  171.     params.forEach(function (item) {
  172.         result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
  173.     });
  174.     return result;
  175. },
  176. // "{b}<br/>{a0}: {c0}MPa<br/>{a1}: {c1}MPa<br/>{a2}: {c2}MPa",
  177. extraCssText:'width:180px;',
  178. position: function (point, params, dom, rect, size) {
  179. // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
  180. // 提示框位置
  181. var x = 0; // x坐标位置
  182. var y = 0; // y坐标位置
  183. // 当前鼠标位置
  184. var pointX = point[0];
  185. var pointY = point[1];
  186. // 外层div大小
  187. // var viewWidth = size.viewSize[0];
  188. // var viewHeight = size.viewSize[1];
  189. // 提示框大小
  190. var boxWidth = size.contentSize[0];
  191. var boxHeight = size.contentSize[1];
  192. // boxWidth > pointX 说明鼠标左边放不下提示框
  193. if (boxWidth > pointX) {
  194. x = 5;
  195. } else { // 左边放的下
  196. x = pointX - boxWidth;
  197. }
  198. // boxHeight > pointY 说明鼠标上边放不下提示框
  199. if (boxHeight > pointY) {
  200. y = 5;
  201. } else { // 上边放得下
  202. y = pointY - boxHeight;
  203. }
  204. return [x, y];
  205. }
  206. },
  207. legend: {
  208. data:['生活水泵1','生活水泵2','生活水泵3'],
  209. textStyle: {
  210. fontSize: 14,
  211. color: '#799dff'
  212. }
  213. },
  214. grid: {
  215. left: '3%',
  216. right: '4%',
  217. bottom: '3%',
  218. containLabel: true
  219. },
  220. xAxis: [{
  221. type: 'category',
  222. boundaryGap: false,
  223. axisLine: {
  224. lineStyle: {
  225. color: 'rgba(128, 128, 128, 0.5)'
  226. }
  227. },
  228. axisLabel: {
  229. margin: 10,
  230. textStyle: {
  231. fontSize: 14,
  232. color: '#999'
  233. }
  234. },
  235. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  236. }],
  237. yAxis: [{
  238. type: 'value',
  239. name: '',
  240. axisTick: {
  241. show: false
  242. },
  243. axisLine: {
  244. show:false,
  245. lineStyle: {
  246. color: '#fff'
  247. }
  248. },
  249. axisLabel: {
  250. margin: 10,
  251. textStyle: {
  252. fontSize: 14,
  253. color: '#799dff'
  254. }
  255. },
  256. min: function(value) {
  257. return Math.round(value.min - 10);
  258. },
  259. max: function(value) {
  260. return Math.round(value.min + 10);
  261. },
  262. splitLine: {
  263. lineStyle: {
  264. type: 'dashed',
  265. color: 'rgba(121, 157, 255, 0.5)'
  266. }
  267. }
  268. }],
  269. series: [{
  270. name: '生活水泵1',
  271. type: 'line',
  272. smooth: true,
  273. symbol: 'circle',
  274. symbolSize: 15,
  275. showSymbol: true,
  276. lineStyle: {
  277. normal: {
  278. width: 3
  279. }
  280. },
  281. markPoint : {
  282. data : [
  283. {type : 'max', name: '最大值'},
  284. {type : 'min', name: '最小值'}
  285. ]
  286. },
  287. markLine : {
  288. data : [
  289. {type : 'average', name: '平均值'},
  290. ],
  291. symbolOffset:[0,0]
  292. },
  293. data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
  294. },
  295. {
  296. name: '生活水泵2',
  297. type: 'line',
  298. smooth: true,
  299. symbol: 'circle',
  300. symbolSize: 15,
  301. showSymbol: true,
  302. lineStyle: {
  303. normal: {
  304. width: 3
  305. }
  306. },
  307. markPoint : {
  308. data : [
  309. {type : 'max', name: '最大值'},
  310. {type : 'min', name: '最小值'}
  311. ],
  312. symbolOffset:[0,-40]
  313. },
  314. markLine : {
  315. data : [
  316. {type : 'average', name: '平均值'},
  317. ]
  318. },
  319. data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
  320. },
  321. {
  322. name: '生活水泵3',
  323. type: 'line',
  324. smooth: true,
  325. symbol: 'circle',
  326. symbolSize: 15,
  327. showSymbol: true,
  328. lineStyle: {
  329. normal: {
  330. width: 3
  331. }
  332. },
  333. markPoint : {
  334. data : [
  335. {type : 'max', name: '最大值'},
  336. {type : 'min', name: '最小值'}
  337. ],
  338. symbolOffset:[0,-80]
  339. },
  340. markLine : {
  341. data : [
  342. {type : 'average', name: '平均值'},
  343. ]
  344. },
  345. data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
  346. },
  347. ]
  348. }
  349. ec_leftbtm.setOption(option);
  350. }
  351. function loadoOption_ec_righttop(){
  352. ec_righttop.clear();
  353. var option = {
  354. title: {
  355. // text: '消防备泵压力监测',
  356. show: true,
  357. textStyle: {
  358. fontWeight: 'normal',
  359. fontSize: 22,
  360. color: '#3db3cb'
  361. },
  362. left: '2%',
  363. top: '2%'
  364. },
  365. tooltip: {
  366. trigger: 'axis',
  367. formatter: function(params) {
  368.     var result = '';
  369. result+= params[0].axisValue+"</br>";
  370.     params.forEach(function (item) {
  371.         result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
  372.     });
  373.     return result;
  374. },
  375. // "{b}<br/>{a}: {c}MPa",
  376. extraCssText:'width:180px;',
  377. position: function (point, params, dom, rect, size) {
  378. // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
  379. // 提示框位置
  380. var x = 0; // x坐标位置
  381. var y = 0; // y坐标位置
  382. // 当前鼠标位置
  383. var pointX = point[0];
  384. var pointY = point[1];
  385. // 外层div大小
  386. // var viewWidth = size.viewSize[0];
  387. // var viewHeight = size.viewSize[1];
  388. // 提示框大小
  389. var boxWidth = size.contentSize[0];
  390. var boxHeight = size.contentSize[1];
  391. // boxWidth > pointX 说明鼠标左边放不下提示框
  392. if (boxWidth > pointX) {
  393. x = 5;
  394. } else { // 左边放的下
  395. x = pointX - boxWidth;
  396. }
  397. // boxHeight > pointY 说明鼠标上边放不下提示框
  398. if (boxHeight > pointY) {
  399. y = 5;
  400. } else { // 上边放得下
  401. y = pointY - boxHeight;
  402. }
  403. return [x, y];
  404. }
  405. },
  406. grid: {
  407. left: '3%',
  408. right: '4%',
  409. bottom: '3%',
  410. containLabel: true
  411. },
  412. xAxis: [{
  413. type: 'category',
  414. boundaryGap: false,
  415. axisLine: {
  416. lineStyle: {
  417. color: 'rgba(128, 128, 128, 0.5)'
  418. }
  419. },
  420. axisLabel: {
  421. margin: 10,
  422. textStyle: {
  423. fontSize: 14,
  424. color: '#999'
  425. }
  426. },
  427. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  428. }],
  429. yAxis: [{
  430. type: 'value',
  431. name: '',
  432. axisTick: {
  433. show: false
  434. },
  435. axisLine: {
  436. show:false,
  437. lineStyle: {
  438. color: '#fff'
  439. }
  440. },
  441. axisLabel: {
  442. margin: 10,
  443. textStyle: {
  444. fontSize: 14,
  445. color: '#799dff'
  446. }
  447. },
  448. min: function(value) {
  449. return Math.round(value.min - 10);
  450. },
  451. max: function(value) {
  452. return Math.round(value.min + 10);
  453. },
  454. splitLine: {
  455. lineStyle: {
  456. type: 'dashed',
  457. color: 'rgba(121, 157, 255, 0.5)'
  458. }
  459. }
  460. }],
  461. series: [{
  462. name: '消防备泵压力',
  463. type: 'line',
  464. smooth: true,
  465. symbol: 'circle',
  466. symbolSize: 15,
  467. showSymbol: true,
  468. lineStyle: {
  469. normal: {
  470. width: 3
  471. }
  472. },
  473. markPoint : {
  474. data : [
  475. {type : 'max', name: '最大值'},
  476. {type : 'min', name: '最小值'}
  477. ]
  478. },
  479. markLine : {
  480. data : [
  481. {type : 'average', name: '平均值'},
  482. ]
  483. },
  484. data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
  485. }]
  486. }
  487. ec_righttop.setOption(option);
  488. }
  489. function loadoOption_ec_lefttop(){
  490. ec_lefttop.clear();
  491. var option = {
  492. title: {
  493. // text: '消防主泵压力监测',
  494. show: true,
  495. textStyle: {
  496. fontWeight: 'normal',
  497. fontSize: 22,
  498. color: '#3db3cb'
  499. },
  500. left: '2%',
  501. top: '2%'
  502. },
  503. tooltip: {
  504. trigger: 'axis',
  505. formatter: function(params) {
  506.     var result = '';
  507. result+= params[0].axisValue+"</br>";
  508.     params.forEach(function (item) {
  509.         result += item.marker + " " + item.seriesName + " : " + item.value +"MPa</br>";
  510.     });
  511.     return result;
  512. },
  513. // "{b}<br/>{a}: {c}MPa",
  514. extraCssText:'width:180px;',
  515. position: function (point, params, dom, rect, size) {
  516. // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
  517. // 提示框位置
  518. var x = 0; // x坐标位置
  519. var y = 0; // y坐标位置
  520. // 当前鼠标位置
  521. var pointX = point[0];
  522. var pointY = point[1];
  523. // 外层div大小
  524. // var viewWidth = size.viewSize[0];
  525. // var viewHeight = size.viewSize[1];
  526. // 提示框大小
  527. var boxWidth = size.contentSize[0];
  528. var boxHeight = size.contentSize[1];
  529. // boxWidth > pointX 说明鼠标左边放不下提示框
  530. if (boxWidth > pointX) {
  531. x = 5;
  532. } else { // 左边放的下
  533. x = pointX - boxWidth;
  534. }
  535. // boxHeight > pointY 说明鼠标上边放不下提示框
  536. if (boxHeight > pointY) {
  537. y = 5;
  538. } else { // 上边放得下
  539. y = pointY - boxHeight;
  540. }
  541. return [x, y];
  542. }
  543. },
  544. grid: {
  545. left: '3%',
  546. right: '4%',
  547. bottom: '3%',
  548. containLabel: true
  549. },
  550. xAxis: [{
  551. type: 'category',
  552. boundaryGap: false,
  553. axisLine: {
  554. lineStyle: {
  555. color: 'rgba(128, 128, 128, 0.5)'
  556. }
  557. },
  558. axisLabel: {
  559. margin: 10,
  560. textStyle: {
  561. fontSize: 14,
  562. color: '#999'
  563. }
  564. },
  565. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  566. }],
  567. yAxis: [{
  568. type: 'value',
  569. name: '',
  570. axisTick: {
  571. show: false
  572. },
  573. axisLine: {
  574. show:false,
  575. lineStyle: {
  576. color: '#fff'
  577. }
  578. },
  579. axisLabel: {
  580. margin: 10,
  581. textStyle: {
  582. fontSize: 14,
  583. color: '#799dff'
  584. }
  585. },
  586. min: function(value) {
  587. return Math.round(value.min - 10);
  588. },
  589. max: function(value) {
  590. return Math.round(value.min + 10);
  591. },
  592. splitLine: {
  593. lineStyle: {
  594. type: 'dashed',
  595. color: 'rgba(121, 157, 255, 0.5)'
  596. }
  597. }
  598. }],
  599. series: [{
  600. name: '消防主泵',
  601. type: 'line',
  602. smooth: true,
  603. symbol: 'circle',
  604. symbolSize: 15,
  605. showSymbol: true,
  606. lineStyle: {
  607. normal: {
  608. width: 3
  609. }
  610. },
  611. markPoint : {
  612. data : [
  613. {type : 'max', name: '最大值'},
  614. {type : 'min', name: '最小值'}
  615. ]
  616. },
  617. markLine : {
  618. data : [
  619. {type : 'average', name: '平均值'},
  620. ]
  621. },
  622. data: [1.2, 0.9, 1.0, 0.5, 1.0, 1.1]
  623. }]
  624. }
  625. ec_lefttop.setOption(option);
  626. }