eleFire.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. /*
  2. 电气火灾页面echarts配置
  3. */
  4. var year = $('#chooseTime').val().slice(0, 4);
  5. var month = $('#chooseTime').val().slice(5, 7);
  6. // 环状饼图定制 (数据统计及时)
  7. (function() {
  8. // 实例化对象
  9. var myChart = echarts.init(document.querySelector(".bar-3d .chart"));
  10. // 生成扇形的曲面参数方程,用于 series-surface.parametricEquation
  11. function getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, height) {
  12. // 计算
  13. let midRatio = (startRatio + endRatio) / 2;
  14. let startRadian = startRatio * Math.PI * 2;
  15. let endRadian = endRatio * Math.PI * 2;
  16. let midRadian = midRatio * Math.PI * 2;
  17. // 如果只有一个扇形,则不实现选中效果。
  18. if (startRatio === 0 && endRatio === 1) {
  19. isSelected = false;
  20. }
  21. // 通过扇形内径/外径的值,换算出辅助参数 k(默认值 1/3)
  22. k = typeof k !== 'undefined' ? k : 1 / 3;
  23. // 计算选中效果分别在 x 轴、y 轴方向上的位移(未选中,则位移均为 0)
  24. let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
  25. let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
  26. // 计算高亮效果的放大比例(未高亮,则比例为 1)
  27. let hoverRate = isHovered ? 1.05 : 1;
  28. // 返回曲面参数方程
  29. return {
  30. u: {
  31. min: -Math.PI,
  32. max: Math.PI * 3,
  33. step: Math.PI / 32
  34. },
  35. v: {
  36. min: 0,
  37. max: Math.PI * 2,
  38. step: Math.PI / 20
  39. },
  40. x: function(u, v) {
  41. if (u < startRadian) {
  42. return offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
  43. }
  44. if (u > endRadian) {
  45. return offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
  46. }
  47. return offsetX + Math.cos(u) * (1 + Math.cos(v) * k) * hoverRate;
  48. },
  49. y: function(u, v) {
  50. if (u < startRadian) {
  51. return offsetY + Math.sin(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
  52. }
  53. if (u > endRadian) {
  54. return offsetY + Math.sin(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
  55. }
  56. return offsetY + Math.sin(u) * (1 + Math.cos(v) * k) * hoverRate;
  57. },
  58. z: function(u, v) {
  59. if (u < -Math.PI * 0.5) {
  60. return Math.sin(u);
  61. }
  62. if (u > Math.PI * 2.5) {
  63. return Math.sin(u);
  64. }
  65. return Math.sin(v) > 0 ? 1 : -1;
  66. }
  67. };
  68. }
  69. // 生成模拟 3D 饼图的配置项
  70. function getPie3D(pieData, internalDiameterRatio) {
  71. let series = [];
  72. let sumValue = 0;
  73. let startValue = 0;
  74. let endValue = 0;
  75. let legendData = [];
  76. let k = typeof internalDiameterRatio !== 'undefined' ? (1 - internalDiameterRatio) / (1 + internalDiameterRatio) : 1 / 3;
  77. // 为每一个饼图数据,生成一个 series-surface 配置
  78. for (let i = 0; i < pieData.length; i++) {
  79. sumValue += pieData[i].value;
  80. let seriesItem = {
  81. name: typeof pieData[i].name === 'undefined' ? `series${i}` : pieData[i].name,
  82. type: 'surface',
  83. parametric: true,
  84. wireframe: {
  85. show: false
  86. },
  87. pieData: pieData[i],
  88. pieStatus: {
  89. selected: false,
  90. hovered: false,
  91. k: k
  92. }
  93. };
  94. if (typeof pieData[i].itemStyle != 'undefined') {
  95. let itemStyle = {};
  96. typeof pieData[i].itemStyle.color != 'undefined' ? itemStyle.color = pieData[i].itemStyle.color : null;
  97. typeof pieData[i].itemStyle.opacity != 'undefined' ? itemStyle.opacity = pieData[i].itemStyle.opacity : null;
  98. seriesItem.itemStyle = itemStyle;
  99. }
  100. series.push(seriesItem);
  101. }
  102. // 使用上一次遍历时,计算出的数据和 sumValue,调用 getParametricEquation 函数,
  103. // 向每个 series-surface 传入不同的参数方程 series-surface.parametricEquation,也就是实现每一个扇形。
  104. for (let i = 0; i < series.length; i++) {
  105. endValue = startValue + series[i].pieData.value;
  106. console.log(series[i]);
  107. series[i].pieData.startRatio = startValue / sumValue;
  108. series[i].pieData.endRatio = endValue / sumValue;
  109. series[i].parametricEquation = getParametricEquation(series[i].pieData.startRatio, series[i].pieData.endRatio, false, false, k, series[i].pieData.value);
  110. startValue = endValue;
  111. legendData.push(series[i].name);
  112. }
  113. // 准备待返回的配置项,把准备好的 legendData、series 传入。
  114. let option = {
  115. tooltip: {
  116. backgroundColor: '#12DFE0',
  117. formatter: params => {
  118. if (params.seriesName !== 'mouseoutSeries') {
  119. // return `${params.seriesName}<br/><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:${params.color};"></span>${option.series[params.seriesIndex].pieData.value}%`;
  120. return `${params.seriesName}: ${option.series[params.seriesIndex].pieData.value}%`;
  121. }
  122. }
  123. },
  124. xAxis3D: {
  125. min: -1,
  126. max: 1
  127. },
  128. yAxis3D: {
  129. min: -1,
  130. max: 1
  131. },
  132. zAxis3D: {
  133. min: -1,
  134. max: 1
  135. },
  136. grid3D: {
  137. show: false,
  138. boxHeight: 40,
  139. top: '-10%',
  140. // bottom: '80%',
  141. // environment: '../images/3d-bg.png', //aa背景色
  142. viewControl: {
  143. distance: 170, //aa距离
  144. alpha: 21, //aa角度
  145. beta: 10, //aa角度
  146. zoomSensitivity: false //是否开启缩放和平移
  147. },
  148. },
  149. series: series
  150. };
  151. return option;
  152. }
  153. // 传入数据生成 option
  154. var option = getPie3D([{
  155. name: '已处理率',
  156. value: 80,
  157. itemStyle: {
  158. opacity: 0.5,
  159. color: 'rgba(0,127,244,.8)',
  160. }
  161. }, {
  162. name: '未处理率',
  163. value: 20,
  164. itemStyle: {
  165. opacity: 0.5,
  166. color: 'rgba(209,126,23,.8)',
  167. }
  168. }
  169. ], 2);
  170. // 把配置给实例对象
  171. myChart.setOption(option);
  172. window.addEventListener("resize", function() {
  173. myChart.resize();
  174. });
  175. })();
  176. // 折线图定制 (数据离散率挖掘)
  177. (function() {
  178. // alert(add0(3))
  179. var sortData = [{
  180. sortName: "三相电压",
  181. data: [
  182. // 两个数组是因为有两条线
  183. [30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, 200, 180, 79, 82, 64, 43, 60, 19, 82, 64, 43, 60, 19, 34],
  184. [123, 175, 112, 197, 121, 67, 98, 21, 43, 64, 76, 38, 24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, ],
  185. [400, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 79, 82, 64, 4]
  186. ]
  187. },
  188. {
  189. sortName: "三相电流",
  190. data: [
  191. // 两个数组是因为有两条线
  192. [143, 19, 34, 40, 64, 191, 324, 290, 330, 310, 131, 165, 123, 178, 21, 82, 64, 43, 60, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, ],
  193. [24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 43, 60, 19, 34],
  194. [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 79, 82, 64, 4]
  195. ]
  196. },
  197. {
  198. sortName: "三相温度",
  199. data: [
  200. // 两个数组是因为有两条线
  201. [24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 43, 60, 19, 34],
  202. [123, 175, 112, 197, 121, 67, 98, 21, 43, 64, 76, 38, 24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, ],
  203. [131, 165, 123, 178, 21, 82, 64, 43, 60, 82, 64, 43, 60, 19, 34, 40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, ]
  204. ]
  205. }, {
  206. sortName: "漏电电流",
  207. data: [
  208. // 两个数组是因为有两条线
  209. [143, 19, 34, 40, 64, 191, 324, 290, 330, 310, 131, 165, 123, 178, 21, 82, 64, 43, 60, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, ],
  210. [24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 43, 60, 19, 34],
  211. [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 79, 82, 64, 4]
  212. ]
  213. },
  214. ];
  215. var xData = function() {
  216. var data = [];
  217. for (var i = 1; i < 31; i++) {
  218. data.push(i);
  219. }
  220. return data;
  221. }();
  222. // 1. 实例化对象
  223. var myChart = echarts.init(document.querySelector(".divergence .chart"));
  224. // 2.指定配置
  225. var option = {
  226. color: [{
  227. colorStops: [{
  228. offset: 0,
  229. color: '#F9860C' // 0% 处的颜色
  230. }, {
  231. offset: 1,
  232. color: '#fff' // 100% 处的颜色
  233. }],
  234. },
  235. {
  236. colorStops: [{
  237. offset: 0,
  238. color: '#07E1F1' // 0% 处的颜色
  239. }, {
  240. offset: 1,
  241. color: '#0456CB' // 100% 处的颜色
  242. }],
  243. },
  244. {
  245. colorStops: [{
  246. offset: 0,
  247. color: '#11F90C' // 0% 处的颜色
  248. }, {
  249. offset: 1,
  250. color: '#3FC713' // 100% 处的颜色
  251. }],
  252. }
  253. ],
  254. // tooltip: {
  255. // trigger: "axis",
  256. // textStyle: {
  257. // align: 'left' //图例左对齐
  258. // },
  259. // },
  260. tooltip: {
  261. trigger: "axis",
  262. textStyle: {
  263. align: 'left' //图例左对齐
  264. },
  265. backgroundColor: '#12DFE0',
  266. // formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:2021年3月{b}日',
  267. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />{a2}: {c2}<br />时间:' + year + '年' + month + '月{b}日'
  268. },
  269. legend: {
  270. // 如果series 对象有name 值,则 legend可以不用写data
  271. itemGap: 20,
  272. itemHeight: 2,
  273. itemWidth: 15,
  274. icon: 'rect',
  275. textStyle: {
  276. color: "#fff"
  277. },
  278. top: "bottom",
  279. },
  280. grid: {
  281. top: "0%",
  282. left: "1%",
  283. right: "1%",
  284. bottom: "15%",
  285. show: true, // 显示边框
  286. borderWidth: '0', //去除边框
  287. containLabel: true // 包含刻度文字在内
  288. },
  289. xAxis: {
  290. type: "category",
  291. boundaryGap: false,
  292. data: xData,
  293. axisTick: {
  294. show: false // 去除刻度线
  295. },
  296. axisLabel: {
  297. color: "#AADDFF" // 文本颜色
  298. },
  299. axisLine: {
  300. lineStyle: {
  301. color: 'rgba(255,255,255,.3)'
  302. }
  303. },
  304. splitNumber: 8,
  305. splitLine: {
  306. show: false
  307. },
  308. splitArea: {
  309. show: true,
  310. areaStyle: {
  311. color: ["rgba(250,250,250,0.05)", "rgba(250,250,250,0.0)"]
  312. }
  313. }
  314. },
  315. yAxis: {
  316. type: "value",
  317. axisTick: {
  318. show: false // 去除刻度线
  319. },
  320. axisLabel: {
  321. show: false // 去除文本
  322. },
  323. axisLine: {
  324. show: false // 去除轴线
  325. },
  326. splitLine: {
  327. lineStyle: {
  328. color: "#012f4a" // 分割线颜色
  329. }
  330. }
  331. },
  332. series: [{
  333. symbol: "none",
  334. name: "方差",
  335. type: "line",
  336. data: sortData[0].data[0]
  337. },
  338. {
  339. symbol: "none",
  340. name: "标准差",
  341. type: "line",
  342. data: sortData[0].data[1]
  343. }, {
  344. symbol: "none",
  345. name: "平均值",
  346. type: "line",
  347. data: sortData[0].data[2]
  348. }
  349. ]
  350. };
  351. myChart.setOption(option);
  352. window.addEventListener("resize", function() {
  353. myChart.resize();
  354. });
  355. // 点击切换效果
  356. $(".divergence .tab-line").on("click", "a", function() {
  357. $(this).addClass('active').siblings().removeClass('active')
  358. var obj = sortData[$(this).index()];
  359. option.series[0].data = obj.data[0];
  360. option.series[1].data = obj.data[1];
  361. option.series[2].data = obj.data[2];
  362. // 重新渲染
  363. myChart.setOption(option);
  364. });
  365. })();
  366. // 折线图定制 (电老化分析)
  367. (function() {
  368. var sortData = [{
  369. sortName: "异常设备",
  370. data: [
  371. // 两个数组是因为有两条线
  372. [24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 43, 60, 19, 34],
  373. [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 79, 82, 64, 4]
  374. ]
  375. },
  376. {
  377. sortName: "漏电告警",
  378. data: [
  379. // 两个数组是因为有两条线
  380. [123, 175, 112, 197, 121, 67, 98, 21, 43, 64, 76, 38, 24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, ],
  381. [143, 131, 165, 123, 178, 21, 82, 64, 43, 60, 19, 34, 40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, ]
  382. ]
  383. }
  384. ];
  385. var xData = function() {
  386. var data = [];
  387. for (var i = 1; i < 31; i++) {
  388. data.push(i);
  389. }
  390. return data;
  391. }();
  392. // 1. 实例化对象
  393. var myChart = echarts.init(document.querySelector(".oldAnalysis .chart"));
  394. // 2.指定配置
  395. var option = {
  396. color: ["#FF9C00", "#0096FF"], // 通过这个color修改两条线的颜色
  397. // tooltip: {
  398. // trigger: "axis",
  399. // textStyle: {
  400. // align: 'left' //图例左对齐
  401. // },
  402. // },
  403. tooltip: {
  404. trigger: "axis",
  405. textStyle: {
  406. align: 'left' //图例左对齐
  407. },
  408. backgroundColor: '#12DFE0',
  409. formatter: '{a0}: {c0}<br />{a1}: {c1}<br />时间:2021年3月{b}日'
  410. },
  411. legend: {
  412. // 如果series 对象有name 值,则 legend可以不用写data
  413. itemGap: 20,
  414. itemHeight: 2,
  415. itemWidth: 15,
  416. icon: 'rect',
  417. textStyle: {
  418. color: "#fff"
  419. },
  420. top: "bottom",
  421. },
  422. grid: {
  423. top: "0%",
  424. left: "1%",
  425. right: "1%",
  426. bottom: "15%",
  427. show: true, // 显示边框
  428. borderWidth: '0', //去除边框
  429. containLabel: true // 包含刻度文字在内
  430. },
  431. xAxis: {
  432. type: "category",
  433. boundaryGap: false,
  434. data: xData,
  435. axisTick: {
  436. show: false // 去除刻度线
  437. },
  438. axisLabel: {
  439. color: "#AADDFF" // 文本颜色
  440. },
  441. axisLine: {
  442. show: false // 去除轴线
  443. }
  444. },
  445. yAxis: {
  446. type: "value",
  447. axisTick: {
  448. show: false // 去除刻度线
  449. },
  450. axisLabel: {
  451. show: false // 去除文本
  452. },
  453. axisLine: {
  454. show: false // 去除轴线
  455. },
  456. splitLine: {
  457. lineStyle: {
  458. color: "#012f4a" // 分割线颜色
  459. }
  460. }
  461. },
  462. series: [{
  463. symbol: "none",
  464. name: "电流",
  465. type: "line",
  466. smooth: true, // true 可以让我们的折线显示带有弧度
  467. areaStyle: {
  468. normal: {
  469. color: new echarts.graphic.LinearGradient(
  470. 0,
  471. 0,
  472. 0,
  473. 1, [{
  474. offset: 0,
  475. color: "rgba(255,156,0, 0.4)"
  476. },
  477. {
  478. offset: 0.8,
  479. color: "rgba(255,156,0, 0.3)"
  480. }
  481. ],
  482. false
  483. ),
  484. shadowColor: "rgba(0, 0, 0, 0.1)"
  485. }
  486. },
  487. data: sortData[0].data[0]
  488. },
  489. {
  490. symbol: "none",
  491. name: "电压",
  492. type: "line",
  493. smooth: true,
  494. areaStyle: {
  495. normal: {
  496. color: new echarts.graphic.LinearGradient(
  497. 0,
  498. 0,
  499. 0,
  500. 1, [{
  501. offset: 0,
  502. color: "rgba(0,150,255,0.5)"
  503. },
  504. {
  505. offset: 0.8,
  506. color: "rgba(0,150,255, 0.1)"
  507. }
  508. ],
  509. false
  510. ),
  511. shadowColor: "rgba(0, 0, 0, 0.1)"
  512. }
  513. },
  514. data: sortData[0].data[1]
  515. }
  516. ]
  517. };
  518. myChart.setOption(option);
  519. window.addEventListener("resize", function() {
  520. myChart.resize();
  521. });
  522. // 点击切换效果
  523. $(".oldAnalysis .tab-line").on("click", "a", function() {
  524. $(this).addClass('active').siblings().removeClass('active')
  525. var obj = sortData[$(this).index()];
  526. option.series[0].data = obj.data[0];
  527. option.series[1].data = obj.data[1];
  528. // 重新渲染
  529. myChart.setOption(option);
  530. });
  531. })();
  532. // 折线图定制 (热老化分析)
  533. (function() {
  534. var sortData = [{
  535. data: [
  536. // 三个数组是因为有3条线
  537. [123, 175, 112, 197, 121, 67, 98, 21, 43, 64, 76, 38, 24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, ],
  538. [24, 52, 26, 27, 30, 35, 36, 40, 120, 230, 210, 120, 213, 180, 200, 180, 79, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 43, 60, 19, 34],
  539. [40, 64, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 9, 191, 324, 290, 330, 310, 213, 180, 200, 180, 79, 82, 64, 79, 82, 64, 4]
  540. ]
  541. }];
  542. var xData = function() {
  543. var data = [];
  544. for (var i = 1; i < 31; i++) {
  545. data.push(i);
  546. }
  547. return data;
  548. }();
  549. // 1. 实例化对象
  550. var myChart = echarts.init(document.querySelector(".hotAnalysis .chart"));
  551. // 2.指定配置
  552. var option = {
  553. color: ["#05EEE7", "#9999FF", "#FE92B3"], // 通过这个color修改三条线的颜色
  554. tooltip: {
  555. trigger: "axis",
  556. textStyle: {
  557. align: 'left' //图例左对齐
  558. },
  559. backgroundColor: '#12DFE0',
  560. formatter: '{a0}: {c0}°C<br />{a1}: {c1}°C<br />{a2}: {c2}°C<br />时间:2021年3月{b}日'
  561. },
  562. legend: {
  563. // 如果series 对象有name 值,则 legend可以不用写data
  564. itemGap: 20,
  565. itemHeight: 2,
  566. itemWidth: 15,
  567. icon: 'rect',
  568. textStyle: {
  569. color: "#fff"
  570. },
  571. top: "bottom",
  572. },
  573. grid: {
  574. top: "0%",
  575. left: "1%",
  576. right: "1%",
  577. bottom: "15%",
  578. show: true, // 显示边框
  579. borderWidth: '0', //去除边框
  580. containLabel: true // 包含刻度文字在内
  581. },
  582. xAxis: {
  583. type: "category",
  584. boundaryGap: false,
  585. data: xData,
  586. axisTick: {
  587. show: false // 去除刻度线
  588. },
  589. axisLabel: {
  590. color: "#AADDFF" // 文本颜色
  591. },
  592. axisLine: {
  593. show: false // 去除轴线
  594. }
  595. },
  596. yAxis: {
  597. type: "value",
  598. axisTick: {
  599. show: false // 去除刻度线
  600. },
  601. axisLabel: {
  602. show: false // 去除文本
  603. },
  604. axisLine: {
  605. show: false // 去除轴线
  606. },
  607. splitLine: {
  608. lineStyle: {
  609. color: "#012f4a" // 分割线颜色
  610. }
  611. }
  612. },
  613. series: [{
  614. symbol: "none",
  615. name: "线缆产生的温度",
  616. type: "line",
  617. smooth: true, // true 可以让我们的折线显示带有弧度
  618. areaStyle: {
  619. normal: {
  620. color: new echarts.graphic.LinearGradient(
  621. 0,
  622. 0,
  623. 0,
  624. 1, [{
  625. offset: 0,
  626. color: "rgba(5,238,231,.6)"
  627. },
  628. {
  629. offset: 0.8,
  630. color: "rgba(5,238,231, 0.4)"
  631. }
  632. ],
  633. false
  634. ),
  635. }
  636. },
  637. data: sortData[0].data[0]
  638. },
  639. {
  640. symbol: "none",
  641. name: "环境温度",
  642. type: "line",
  643. smooth: true,
  644. areaStyle: {
  645. normal: {
  646. color: new echarts.graphic.LinearGradient(
  647. 0,
  648. 0,
  649. 0,
  650. 1, [{
  651. offset: 0,
  652. color: "rgba(153,153,255,.6)"
  653. },
  654. {
  655. offset: 0.8,
  656. color: "rgba(153,153,255, 0.4)"
  657. }
  658. ],
  659. false
  660. ),
  661. }
  662. },
  663. data: sortData[0].data[1]
  664. },
  665. {
  666. symbol: "none",
  667. name: "线缆温度",
  668. type: "line",
  669. smooth: true,
  670. areaStyle: {
  671. normal: {
  672. color: new echarts.graphic.LinearGradient(
  673. 0,
  674. 0,
  675. 0,
  676. 1, [{
  677. offset: 0,
  678. color: "rgba(255,147,180,.6)"
  679. },
  680. {
  681. offset: 0.8,
  682. color: "rgba(255,147,180, 0.4)"
  683. }
  684. ],
  685. false
  686. ),
  687. }
  688. },
  689. data: sortData[0].data[2]
  690. }
  691. ]
  692. };
  693. myChart.setOption(option);
  694. window.addEventListener("resize", function() {
  695. myChart.resize();
  696. });
  697. })();