sensor_dianya.js 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  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_leftbtm();
  12. loadoOption_ec_rightbtm();
  13. }) ;
  14. function loadoOption_ec_lefttop(){
  15. ec_lefttop.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. extraCssText:'width:180px;',
  31. formatter: function(params) {
  32.     var result = '';
  33. result+= params[0].axisValue+"</br>";
  34.     params.forEach(function (item) {
  35.         result += item.marker + " " + item.seriesName + " : " + item.value +"V</br>";
  36.     });
  37.     return result;
  38. },
  39. // "{b}<br/>{a0}: {c0}V<br/>{a1}: {c1}V<br/>{a2}: {c2}V",
  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. legend: {
  70. data:['泵房喷淋泵电压','泵房消防泵电压','泵房生活水泵电压'],
  71. textStyle: {
  72. fontSize: 14,
  73. color: '#799dff'
  74. }
  75. },
  76. grid: {
  77. left: '3%',
  78. right: '4%',
  79. bottom: '3%',
  80. containLabel: true
  81. },
  82. xAxis: [{
  83. type: 'category',
  84. boundaryGap: false,
  85. axisLine: {
  86. lineStyle: {
  87. color: 'rgba(128, 128, 128, 0.5)'
  88. }
  89. },
  90. axisLabel: {
  91. margin: 10,
  92. textStyle: {
  93. fontSize: 14,
  94. color: '#999'
  95. }
  96. },
  97. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  98. }],
  99. yAxis: [{
  100. type: 'value',
  101. name: '',
  102. min: function(value) {
  103. return Math.round(value.min - 10);
  104. },
  105. max: function(value) {
  106. return Math.round(value.min + 10);
  107. },
  108. axisTick: {
  109. show: false
  110. },
  111. axisLine: {
  112. show:false,
  113. lineStyle: {
  114. color: '#fff'
  115. }
  116. },
  117. axisLabel: {
  118. margin: 10,
  119. textStyle: {
  120. fontSize: 14,
  121. color: '#799dff'
  122. }
  123. },
  124. splitLine: {
  125. lineStyle: {
  126. type: 'dashed',
  127. color: 'rgba(121, 157, 255, 0.5)'
  128. }
  129. }
  130. }],
  131. series: [{
  132. name: '泵房喷淋泵电压',
  133. type: 'line',
  134. smooth: true,
  135. symbol: 'circle',
  136. symbolSize: 15,
  137. showSymbol: true,
  138. lineStyle: {
  139. normal: {
  140. width: 3
  141. }
  142. },
  143. markPoint : {
  144. data : [
  145. {type : 'max', name: '最大值'},
  146. {type : 'min', name: '最小值'}
  147. ]
  148. },
  149. markLine : {
  150. data : [
  151. {type : 'average', name: '平均值'},
  152. ]
  153. },
  154. data: [381, 381, 381, 381, 381, 381]
  155. },
  156. {
  157. name: '泵房消防泵电压',
  158. type: 'line',
  159. smooth: true,
  160. symbol: 'circle',
  161. symbolSize: 15,
  162. showSymbol: true,
  163. lineStyle: {
  164. normal: {
  165. width: 3
  166. }
  167. },
  168. markPoint : {
  169. data : [
  170. {type : 'max', name: '最大值'},
  171. {type : 'min', name: '最小值'}
  172. ]
  173. },
  174. markLine : {
  175. data : [
  176. {type : 'average', name: '平均值'},
  177. ]
  178. },
  179. data:[381, 381, 381, 381, 381, 381]
  180. },
  181. {
  182. name: '泵房生活水泵电压',
  183. type: 'line',
  184. smooth: true,
  185. symbol: 'circle',
  186. symbolSize: 15,
  187. showSymbol: true,
  188. lineStyle: {
  189. normal: {
  190. width: 3
  191. }
  192. },
  193. markPoint : {
  194. data : [
  195. {type : 'max', name: '最大值'},
  196. {type : 'min', name: '最小值'}
  197. ]
  198. },
  199. markLine : {
  200. data : [
  201. {type : 'average', name: '平均值'},
  202. ]
  203. },
  204. data: [381, 381, 381, 381, 381, 381]
  205. },
  206. ]
  207. }
  208. ec_lefttop.setOption(option);
  209. }
  210. function loadoOption_ec_righttop(){
  211. ec_righttop.clear();
  212. var option = {
  213. title: {
  214. text: '',
  215. show: true,
  216. textStyle: {
  217. fontWeight: 'normal',
  218. fontSize: 22,
  219. color: '#3db3cb'
  220. },
  221. left: '2%',
  222. top: '2%'
  223. },
  224. tooltip: {
  225. trigger: 'axis',
  226. formatter: function(params) {
  227.     var result = '';
  228. result+= params[0].axisValue+"</br>";
  229.     params.forEach(function (item) {
  230.         result += item.marker + " " + item.seriesName + " : " + item.value +"A</br>";
  231.     });
  232.     return result;
  233. },
  234. // "{b}<br/>{a0}: {c0}A<br/>{a1}: {c1}A<br/>{a2}: {c2}A<br/>{a3}: {c3}A<br/>{a4}: {c4}A<br/>{a5}: {c5}A<br/>{a6}: {c6}A<br/>{a7}: {c7}A<br/>{a8}: {c8}A",
  235. extraCssText:'width:180px;',
  236. position: function (point, params, dom, rect, size) {
  237. // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
  238. // 提示框位置
  239. var x = 0; // x坐标位置
  240. var y = 0; // y坐标位置
  241. // 当前鼠标位置
  242. var pointX = point[0];
  243. var pointY = point[1];
  244. // 外层div大小
  245. // var viewWidth = size.viewSize[0];
  246. // var viewHeight = size.viewSize[1];
  247. // 提示框大小
  248. var boxWidth = size.contentSize[0];
  249. var boxHeight = size.contentSize[1];
  250. // boxWidth > pointX 说明鼠标左边放不下提示框
  251. if (boxWidth > pointX) {
  252. x = 5;
  253. } else { // 左边放的下
  254. x = pointX - boxWidth;
  255. }
  256. // boxHeight > pointY 说明鼠标上边放不下提示框
  257. if (boxHeight > pointY) {
  258. y = 5;
  259. } else { // 上边放得下
  260. y = pointY - boxHeight;
  261. }
  262. return [x, y];
  263. }
  264. },
  265. legend: {
  266. data:['生活水泵','喷淋泵','消防泵','风AUH-1F','风AUH-2F-4','风AUH-2F-2','风AUH-1F-1','风AUH-2F-3','风SF2F-1','风AUH-2F-1'],
  267. textStyle: {
  268. fontSize: 14,
  269. color: '#799dff'
  270. }
  271. },
  272. grid: {
  273. left: '3%',
  274. right: '4%',
  275. bottom: '3%',
  276. containLabel: true
  277. },
  278. xAxis: [{
  279. type: 'category',
  280. boundaryGap: false,
  281. axisLine: {
  282. lineStyle: {
  283. color: 'rgba(128, 128, 128, 0.5)'
  284. }
  285. },
  286. axisLabel: {
  287. margin: 10,
  288. textStyle: {
  289. fontSize: 14,
  290. color: '#999'
  291. }
  292. },
  293. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  294. }],
  295. yAxis: [{
  296. type: 'value',
  297. name: '',
  298. axisTick: {
  299. show: false
  300. },
  301. axisLine: {
  302. show:false,
  303. lineStyle: {
  304. color: '#fff'
  305. }
  306. },
  307. axisLabel: {
  308. margin: 10,
  309. textStyle: {
  310. fontSize: 14,
  311. color: '#799dff'
  312. }
  313. },
  314. splitLine: {
  315. lineStyle: {
  316. type: 'dashed',
  317. color: 'rgba(121, 157, 255, 0.5)'
  318. }
  319. }
  320. }],
  321. series: [{
  322. name: '生活水泵',
  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. },
  339. data: [0, 0, 0, 0, 0, 0]
  340. },
  341. {
  342. name: '喷淋泵',
  343. type: 'line',
  344. smooth: true,
  345. symbol: 'circle',
  346. symbolSize: 15,
  347. showSymbol: true,
  348. lineStyle: {
  349. normal: {
  350. width: 3
  351. }
  352. },
  353. markPoint : {
  354. data : [
  355. {type : 'max', name: '最大值'},
  356. {type : 'min', name: '最小值'}
  357. ]
  358. },
  359. data: [0, 0, 0, 0, 0, 0]
  360. },
  361. {
  362. name: '消防泵',
  363. type: 'line',
  364. smooth: true,
  365. symbol: 'circle',
  366. symbolSize: 15,
  367. showSymbol: true,
  368. lineStyle: {
  369. normal: {
  370. width: 3
  371. }
  372. },
  373. markPoint : {
  374. data : [
  375. {type : 'max', name: '最大值'},
  376. {type : 'min', name: '最小值'}
  377. ]
  378. },
  379. data: [0, 0, 0, 0, 0, 0]
  380. },
  381. {
  382. name: '风AUH-1F',
  383. type: 'line',
  384. smooth: true,
  385. symbol: 'circle',
  386. symbolSize: 15,
  387. showSymbol: true,
  388. lineStyle: {
  389. normal: {
  390. width: 3
  391. }
  392. },
  393. markPoint : {
  394. data : [
  395. {type : 'max', name: '最大值'},
  396. {type : 'min', name: '最小值'}
  397. ]
  398. },
  399. data: [0, 0, 0, 0, 0, 0]
  400. },
  401. {
  402. name: '风AUH-2F-4',
  403. type: 'line',
  404. smooth: true,
  405. symbol: 'circle',
  406. symbolSize: 15,
  407. showSymbol: true,
  408. lineStyle: {
  409. normal: {
  410. width: 3
  411. }
  412. },
  413. markPoint : {
  414. data : [
  415. {type : 'max', name: '最大值'},
  416. {type : 'min', name: '最小值'}
  417. ]
  418. },
  419. data: [0, 0, 0, 0, 0, 0]
  420. },
  421. {
  422. name: '风AUH-2F-2',
  423. type: 'line',
  424. smooth: true,
  425. symbol: 'circle',
  426. symbolSize: 15,
  427. showSymbol: true,
  428. lineStyle: {
  429. normal: {
  430. width: 3
  431. }
  432. },
  433. markPoint : {
  434. data : [
  435. {type : 'max', name: '最大值'},
  436. {type : 'min', name: '最小值'}
  437. ]
  438. },
  439. data: [0, 0, 0, 0, 0, 0]
  440. },
  441. {
  442. name: '风AUH-1F-1',
  443. type: 'line',
  444. smooth: true,
  445. symbol: 'circle',
  446. symbolSize: 15,
  447. showSymbol: true,
  448. lineStyle: {
  449. normal: {
  450. width: 3
  451. }
  452. },
  453. markPoint : {
  454. data : [
  455. {type : 'max', name: '最大值'},
  456. {type : 'min', name: '最小值'}
  457. ]
  458. },
  459. data: [0, 0, 0, 0, 0, 0]
  460. },
  461. {
  462. name: '风AUH-2F-3',
  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. data: [0, 0, 0, 0, 0, 0]
  480. },
  481. {
  482. name: '风SF2F-1',
  483. type: 'line',
  484. smooth: true,
  485. symbol: 'circle',
  486. symbolSize: 15,
  487. showSymbol: true,
  488. lineStyle: {
  489. normal: {
  490. width: 3
  491. }
  492. },
  493. markPoint : {
  494. data : [
  495. {type : 'max', name: '最大值'},
  496. {type : 'min', name: '最小值'}
  497. ]
  498. },
  499. data: [0, 0, 0, 0, 0, 0]
  500. },
  501. {
  502. name: '风AUH-2F-1',
  503. type: 'line',
  504. smooth: true,
  505. symbol: 'circle',
  506. symbolSize: 15,
  507. showSymbol: true,
  508. lineStyle: {
  509. normal: {
  510. width: 3
  511. }
  512. },
  513. markPoint : {
  514. data : [
  515. {type : 'max', name: '最大值'},
  516. {type : 'min', name: '最小值'}
  517. ]
  518. },
  519. data: [0, 0, 0, 0, 0, 0]
  520. }]
  521. }
  522. ec_righttop.setOption(option);
  523. }
  524. function loadoOption_ec_leftbtm(){
  525. ec_leftbtm.clear();
  526. var option = {
  527. title: {
  528. text: '',
  529. show: true,
  530. textStyle: {
  531. fontWeight: 'normal',
  532. fontSize: 22,
  533. color: '#3db3cb'
  534. },
  535. left: '2%',
  536. top: '2%'
  537. },
  538. tooltip: {
  539. trigger: 'axis',
  540. formatter: function(params) {
  541.     var result = '';
  542. result+= params[0].axisValue+"</br>";
  543.     params.forEach(function (item) {
  544.         result += item.marker + " " + item.seriesName + " : " + item.value +"A</br>";
  545.     });
  546.     return result;
  547. },
  548. // "{b}<br/>{a0}: {c0}A<br/>{a1}: {c1}A<br/>{a2}: {c2}A<br/>{a3}: {c3}A<br/>{a4}: {c4}A<br/>{a5}: {c5}A<br/>{a6}: {c6}A<br/>{a7}: {c7}A<br/>{a8}: {c8}A<br/>{a9}: {c9}A",
  549. extraCssText:'width:180px;',
  550. position: function (point, params, dom, rect, size) {
  551. // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
  552. // 提示框位置
  553. var x = 0; // x坐标位置
  554. var y = 0; // y坐标位置
  555. // 当前鼠标位置
  556. var pointX = point[0];
  557. var pointY = point[1];
  558. // 外层div大小
  559. // var viewWidth = size.viewSize[0];
  560. // var viewHeight = size.viewSize[1];
  561. // 提示框大小
  562. var boxWidth = size.contentSize[0];
  563. var boxHeight = size.contentSize[1];
  564. // boxWidth > pointX 说明鼠标左边放不下提示框
  565. if (boxWidth > pointX) {
  566. x = 5;
  567. } else { // 左边放的下
  568. x = pointX - boxWidth;
  569. }
  570. // boxHeight > pointY 说明鼠标上边放不下提示框
  571. if (boxHeight > pointY) {
  572. y = 5;
  573. } else { // 上边放得下
  574. y = pointY - boxHeight;
  575. }
  576. return [x, y];
  577. }
  578. },
  579. legend: {
  580. data:['风FAU-3F-2','风EF-3F-1','风EF-3F-2','风AHU-4F-2','风FAU-4F-2','风AUH-3F-1','风AHU-4F-1','风FAU-4F-1','风SF-3F-1','风FAU-3F-1'],
  581. textStyle: {
  582. fontSize: 14,
  583. color: '#799dff'
  584. }
  585. },
  586. grid: {
  587. left: '3%',
  588. right: '4%',
  589. bottom: '3%',
  590. containLabel: true
  591. },
  592. xAxis: [{
  593. type: 'category',
  594. boundaryGap: false,
  595. axisLine: {
  596. lineStyle: {
  597. color: 'rgba(128, 128, 128, 0.5)'
  598. }
  599. },
  600. axisLabel: {
  601. margin: 10,
  602. textStyle: {
  603. fontSize: 14,
  604. color: '#999'
  605. }
  606. },
  607. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  608. }],
  609. yAxis: [{
  610. type: 'value',
  611. name: '',
  612. axisTick: {
  613. show: false
  614. },
  615. axisLine: {
  616. show:false,
  617. lineStyle: {
  618. color: '#fff'
  619. }
  620. },
  621. axisLabel: {
  622. margin: 10,
  623. textStyle: {
  624. fontSize: 14,
  625. color: '#799dff'
  626. }
  627. },
  628. splitLine: {
  629. lineStyle: {
  630. type: 'dashed',
  631. color: 'rgba(121, 157, 255, 0.5)'
  632. }
  633. }
  634. }],
  635. series: [{
  636. name: '风FAU-3F-2',
  637. type: 'line',
  638. smooth: true,
  639. symbol: 'circle',
  640. symbolSize: 15,
  641. showSymbol: true,
  642. lineStyle: {
  643. normal: {
  644. width: 3
  645. }
  646. },
  647. markPoint : {
  648. data : [
  649. {type : 'max', name: '最大值'},
  650. {type : 'min', name: '最小值'}
  651. ]
  652. },
  653. data: [0, 0, 0, 0, 0, 0]
  654. },
  655. {
  656. name: '风EF-3F-1',
  657. type: 'line',
  658. smooth: true,
  659. symbol: 'circle',
  660. symbolSize: 15,
  661. showSymbol: true,
  662. lineStyle: {
  663. normal: {
  664. width: 3
  665. }
  666. },
  667. markPoint : {
  668. data : [
  669. {type : 'max', name: '最大值'},
  670. {type : 'min', name: '最小值'}
  671. ]
  672. },
  673. data: [0, 0, 0, 0, 0, 0]
  674. },
  675. {
  676. name: '风EF-3F-2',
  677. type: 'line',
  678. smooth: true,
  679. symbol: 'circle',
  680. symbolSize: 15,
  681. showSymbol: true,
  682. lineStyle: {
  683. normal: {
  684. width: 3
  685. }
  686. },
  687. markPoint : {
  688. data : [
  689. {type : 'max', name: '最大值'},
  690. {type : 'min', name: '最小值'}
  691. ]
  692. },
  693. data: [0, 0, 0, 0, 0, 0]
  694. },
  695. {
  696. name: '风AHU-4F-2',
  697. type: 'line',
  698. smooth: true,
  699. symbol: 'circle',
  700. symbolSize: 15,
  701. showSymbol: true,
  702. lineStyle: {
  703. normal: {
  704. width: 3
  705. }
  706. },
  707. markPoint : {
  708. data : [
  709. {type : 'max', name: '最大值'},
  710. {type : 'min', name: '最小值'}
  711. ]
  712. },
  713. data: [0, 0, 0, 0, 0, 0]
  714. },
  715. {
  716. name: '风FAU-4F-2',
  717. type: 'line',
  718. smooth: true,
  719. symbol: 'circle',
  720. symbolSize: 15,
  721. showSymbol: true,
  722. lineStyle: {
  723. normal: {
  724. width: 3
  725. }
  726. },
  727. markPoint : {
  728. data : [
  729. {type : 'max', name: '最大值'},
  730. {type : 'min', name: '最小值'}
  731. ]
  732. },
  733. data: [0, 0, 0, 0, 0, 0]
  734. },
  735. {
  736. name: '风AUH-3F-1',
  737. type: 'line',
  738. smooth: true,
  739. symbol: 'circle',
  740. symbolSize: 15,
  741. showSymbol: true,
  742. lineStyle: {
  743. normal: {
  744. width: 3
  745. }
  746. },
  747. markPoint : {
  748. data : [
  749. {type : 'max', name: '最大值'},
  750. {type : 'min', name: '最小值'}
  751. ]
  752. },
  753. data: [0, 0, 0, 0, 0, 0]
  754. },
  755. {
  756. name: '风AHU-4F-1',
  757. type: 'line',
  758. smooth: true,
  759. symbol: 'circle',
  760. symbolSize: 15,
  761. showSymbol: true,
  762. lineStyle: {
  763. normal: {
  764. width: 3
  765. }
  766. },
  767. markPoint : {
  768. data : [
  769. {type : 'max', name: '最大值'},
  770. {type : 'min', name: '最小值'}
  771. ]
  772. },
  773. data: [0, 0, 0, 0, 0, 0]
  774. },
  775. {
  776. name: '风FAU-4F-1',
  777. type: 'line',
  778. smooth: true,
  779. symbol: 'circle',
  780. symbolSize: 15,
  781. showSymbol: true,
  782. lineStyle: {
  783. normal: {
  784. width: 3
  785. }
  786. },
  787. markPoint : {
  788. data : [
  789. {type : 'max', name: '最大值'},
  790. {type : 'min', name: '最小值'}
  791. ]
  792. },
  793. data: [0, 0, 0, 0, 0, 0]
  794. },
  795. {
  796. name: '风SF-3F-1',
  797. type: 'line',
  798. smooth: true,
  799. symbol: 'circle',
  800. symbolSize: 15,
  801. showSymbol: true,
  802. lineStyle: {
  803. normal: {
  804. width: 3
  805. }
  806. },
  807. markPoint : {
  808. data : [
  809. {type : 'max', name: '最大值'},
  810. {type : 'min', name: '最小值'}
  811. ]
  812. },
  813. data: [0, 0, 0, 0, 0, 0]
  814. },
  815. {
  816. name: '风FAU-3F-1',
  817. type: 'line',
  818. smooth: true,
  819. symbol: 'circle',
  820. symbolSize: 15,
  821. showSymbol: true,
  822. lineStyle: {
  823. normal: {
  824. width: 3
  825. }
  826. },
  827. markPoint : {
  828. data : [
  829. {type : 'max', name: '最大值'},
  830. {type : 'min', name: '最小值'}
  831. ]
  832. },
  833. data: [0, 0, 0, 0, 0, 0]
  834. }]
  835. }
  836. ec_leftbtm.setOption(option);
  837. }
  838. function loadoOption_ec_rightbtm(){
  839. ec_rightbtm.clear();
  840. var option = {
  841. title: {
  842. text: '',
  843. show: true,
  844. textStyle: {
  845. fontWeight: 'normal',
  846. fontSize: 22,
  847. color: '#3db3cb'
  848. },
  849. left: '2%',
  850. top: '2%'
  851. },
  852. tooltip: {
  853. trigger: 'axis',
  854. formatter: function(params) {
  855.     var result = '';
  856. result+= params[0].axisValue+"</br>";
  857.     params.forEach(function (item) {
  858.         result += item.marker + " " + item.seriesName + " : " + item.value +"A</br>";
  859.     });
  860.     return result;
  861. },
  862. // "{b}<br/>{a0}: {c0}A<br/>{a1}: {c1}A<br/>{a2}: {c2}A<br/>{a3}: {c3}A<br/>{a4}: {c4}A<br/>{a5}: {c5}A<br/>{a6}: {c6}A<br/>{a7}: {c7}A<br/>{a8}: {c8}A",
  863. extraCssText:'width:180px;',
  864. position: function (point, params, dom, rect, size) {
  865. // 鼠标坐标和提示框位置的参考坐标系是:以外层div的左上角那一点为原点,x轴向右,y轴向下
  866. // 提示框位置
  867. var x = 0; // x坐标位置
  868. var y = 0; // y坐标位置
  869. // 当前鼠标位置
  870. var pointX = point[0];
  871. var pointY = point[1];
  872. // 外层div大小
  873. // var viewWidth = size.viewSize[0];
  874. // var viewHeight = size.viewSize[1];
  875. // 提示框大小
  876. var boxWidth = size.contentSize[0];
  877. var boxHeight = size.contentSize[1];
  878. // boxWidth > pointX 说明鼠标左边放不下提示框
  879. if (boxWidth > pointX) {
  880. x = 5;
  881. } else { // 左边放的下
  882. x = pointX - boxWidth;
  883. }
  884. // boxHeight > pointY 说明鼠标上边放不下提示框
  885. if (boxHeight > pointY) {
  886. y = 5;
  887. } else { // 上边放得下
  888. y = pointY - boxHeight;
  889. }
  890. return [x, y];
  891. }
  892. },
  893. legend: {
  894. data:['剧场后排风机','剧场大厅风机','剧场顶风机','剧场前排风机','空调1号','空调2号','空调3号','空调4号','空调5号'],
  895. textStyle: {
  896. fontSize: 14,
  897. color: '#799dff'
  898. }
  899. },
  900. grid: {
  901. left: '3%',
  902. right: '4%',
  903. bottom: '3%',
  904. containLabel: true
  905. },
  906. xAxis: [{
  907. type: 'category',
  908. boundaryGap: false,
  909. axisLine: {
  910. lineStyle: {
  911. color: 'rgba(128, 128, 128, 0.5)'
  912. }
  913. },
  914. axisLabel: {
  915. margin: 10,
  916. textStyle: {
  917. fontSize: 14,
  918. color: '#999'
  919. }
  920. },
  921. data: ['12:00:00', '12:00:05', '12:00:10', '12:00:15', '12:00:20', '12:00:25']
  922. }],
  923. yAxis: [{
  924. type: 'value',
  925. name: '',
  926. axisTick: {
  927. show: false
  928. },
  929. axisLine: {
  930. show:false,
  931. lineStyle: {
  932. color: '#fff'
  933. }
  934. },
  935. axisLabel: {
  936. margin: 10,
  937. textStyle: {
  938. fontSize: 14,
  939. color: '#799dff'
  940. }
  941. },
  942. splitLine: {
  943. lineStyle: {
  944. type: 'dashed',
  945. color: 'rgba(121, 157, 255, 0.5)'
  946. }
  947. }
  948. }],
  949. series: [{
  950. name: '剧场后排风机',
  951. type: 'line',
  952. smooth: true,
  953. symbol: 'circle',
  954. symbolSize: 15,
  955. showSymbol: true,
  956. lineStyle: {
  957. normal: {
  958. width: 3
  959. }
  960. },
  961. markPoint : {
  962. data : [
  963. {type : 'max', name: '最大值'},
  964. {type : 'min', name: '最小值'}
  965. ]
  966. },
  967. data: [0, 0, 0, 0, 0, 0]
  968. },
  969. {
  970. name: '剧场大厅风机',
  971. type: 'line',
  972. smooth: true,
  973. symbol: 'circle',
  974. symbolSize: 15,
  975. showSymbol: true,
  976. lineStyle: {
  977. normal: {
  978. width: 3
  979. }
  980. },
  981. markPoint : {
  982. data : [
  983. {type : 'max', name: '最大值'},
  984. {type : 'min', name: '最小值'}
  985. ]
  986. },
  987. data: [0, 0, 0, 0, 0, 0]
  988. },
  989. {
  990. name: '剧场顶风机',
  991. type: 'line',
  992. smooth: true,
  993. symbol: 'circle',
  994. symbolSize: 15,
  995. showSymbol: true,
  996. lineStyle: {
  997. normal: {
  998. width: 3
  999. }
  1000. },
  1001. markPoint : {
  1002. data : [
  1003. {type : 'max', name: '最大值'},
  1004. {type : 'min', name: '最小值'}
  1005. ]
  1006. },
  1007. data: [0, 0, 0, 0, 0, 0]
  1008. },
  1009. {
  1010. name: '剧场前排风机',
  1011. type: 'line',
  1012. smooth: true,
  1013. symbol: 'circle',
  1014. symbolSize: 15,
  1015. showSymbol: true,
  1016. lineStyle: {
  1017. normal: {
  1018. width: 3
  1019. }
  1020. },
  1021. markPoint : {
  1022. data : [
  1023. {type : 'max', name: '最大值'},
  1024. {type : 'min', name: '最小值'}
  1025. ]
  1026. },
  1027. data: [0, 0, 0, 0, 0, 0]
  1028. },
  1029. {
  1030. name: '空调1号',
  1031. type: 'line',
  1032. smooth: true,
  1033. symbol: 'circle',
  1034. symbolSize: 15,
  1035. showSymbol: true,
  1036. lineStyle: {
  1037. normal: {
  1038. width: 3
  1039. }
  1040. },
  1041. markPoint : {
  1042. data : [
  1043. {type : 'max', name: '最大值'},
  1044. {type : 'min', name: '最小值'}
  1045. ]
  1046. },
  1047. data: [0, 0, 0, 0, 0, 0]
  1048. },
  1049. {
  1050. name: '空调2号',
  1051. type: 'line',
  1052. smooth: true,
  1053. symbol: 'circle',
  1054. symbolSize: 15,
  1055. showSymbol: true,
  1056. lineStyle: {
  1057. normal: {
  1058. width: 3
  1059. }
  1060. },
  1061. markPoint : {
  1062. data : [
  1063. {type : 'max', name: '最大值'},
  1064. {type : 'min', name: '最小值'}
  1065. ]
  1066. },
  1067. data: [0, 0, 0, 0, 0, 0]
  1068. },
  1069. {
  1070. name: '空调3号',
  1071. type: 'line',
  1072. smooth: true,
  1073. symbol: 'circle',
  1074. symbolSize: 15,
  1075. showSymbol: true,
  1076. lineStyle: {
  1077. normal: {
  1078. width: 3
  1079. }
  1080. },
  1081. markPoint : {
  1082. data : [
  1083. {type : 'max', name: '最大值'},
  1084. {type : 'min', name: '最小值'}
  1085. ]
  1086. },
  1087. data: [0, 0, 0, 0, 0, 0]
  1088. },
  1089. {
  1090. name: '空调4号',
  1091. type: 'line',
  1092. smooth: true,
  1093. symbol: 'circle',
  1094. symbolSize: 15,
  1095. showSymbol: true,
  1096. lineStyle: {
  1097. normal: {
  1098. width: 3
  1099. }
  1100. },
  1101. markPoint : {
  1102. data : [
  1103. {type : 'max', name: '最大值'},
  1104. {type : 'min', name: '最小值'}
  1105. ]
  1106. },
  1107. data: [0, 0, 0, 0, 0, 0]
  1108. },
  1109. {
  1110. name: '空调5号',
  1111. type: 'line',
  1112. smooth: true,
  1113. symbol: 'circle',
  1114. symbolSize: 15,
  1115. showSymbol: true,
  1116. lineStyle: {
  1117. normal: {
  1118. width: 3
  1119. }
  1120. },
  1121. markPoint : {
  1122. data : [
  1123. {type : 'max', name: '最大值'},
  1124. {type : 'min', name: '最小值'}
  1125. ]
  1126. },
  1127. data: [0, 0, 0, 0, 0, 0]
  1128. }]
  1129. }
  1130. ec_rightbtm.setOption(option);
  1131. }