water.js 24 KB

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