data.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836
  1. import * as echarts from "echarts";
  2. export const pie = {
  3. title: [
  4. {
  5. text: "场内拥堵率",
  6. x: "center",
  7. top: "52%",
  8. textStyle: {
  9. color: "#FFFFFF",
  10. fontSize: 21,
  11. fontFamily: 'MFLiHei',
  12. },
  13. },
  14. {
  15. text: `30%`,
  16. x: "center",
  17. top: "28%",
  18. textStyle: {
  19. fontSize: "40",
  20. color: "#FFFFFF",
  21. fontFamily: "DINAlternate-Bold, DINAlternate",
  22. foontWeight: "600",
  23. },
  24. },
  25. ],
  26. backgroundColor: "rgba(0,0,0,0)",
  27. polar: {
  28. radius: ["63%", "75%"],
  29. center: ["50%", "50%"],
  30. },
  31. angleAxis: {
  32. max: 100,
  33. show: false,
  34. },
  35. radiusAxis: {
  36. type: "category",
  37. show: true,
  38. axisLabel: {
  39. show: false,
  40. },
  41. axisLine: {
  42. show: false,
  43. },
  44. axisTick: {
  45. show: false,
  46. },
  47. },
  48. series: [
  49. {
  50. name: "",
  51. type: "bar",
  52. roundCap: true,
  53. barWidth: 50,
  54. showBackground: true,
  55. backgroundStyle: {
  56. color: "rgba(66, 66, 66, 0)",
  57. },
  58. data: [30],
  59. coordinateSystem: "polar",
  60. itemStyle: {
  61. normal: {
  62. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  63. {
  64. offset: 0,
  65. color: "#fcc451",
  66. },
  67. {
  68. offset: 1,
  69. color: "#66ffff",
  70. },
  71. ]),
  72. },
  73. },
  74. },
  75. ],
  76. }
  77. export const pie2 = {
  78. title: [
  79. {
  80. text: "场内异常率",
  81. x: "center",
  82. top: "52%",
  83. textStyle: {
  84. color: "#FFFFFF",
  85. fontSize: 21,
  86. fontFamily: 'MFLiHei',
  87. },
  88. },
  89. {
  90. text: `30%`,
  91. x: "center",
  92. top: "25%",
  93. textStyle: {
  94. fontSize: "40",
  95. color: "#FFFFFF",
  96. fontFamily: "DINAlternate-Bold, DINAlternate",
  97. foontWeight: "600",
  98. },
  99. },
  100. ],
  101. backgroundColor: "rgba(0,0,0,0)",
  102. polar: {
  103. radius: ["63%", "75%"],
  104. center: ["50%", "50%"],
  105. },
  106. angleAxis: {
  107. max: 100,
  108. show: false,
  109. },
  110. radiusAxis: {
  111. type: "category",
  112. show: true,
  113. axisLabel: {
  114. show: false,
  115. },
  116. axisLine: {
  117. show: false,
  118. },
  119. axisTick: {
  120. show: false,
  121. },
  122. },
  123. series: [
  124. {
  125. name: "",
  126. type: "bar",
  127. roundCap: true,
  128. barWidth: 50,
  129. showBackground: true,
  130. backgroundStyle: {
  131. color: "rgba(66, 66, 66, 0)",
  132. },
  133. data: [30],
  134. coordinateSystem: "polar",
  135. itemStyle: {
  136. normal: {
  137. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [
  138. {
  139. offset: 0,
  140. color: "#fcc451",
  141. },
  142. {
  143. offset: 1,
  144. color: "#3e94fa",
  145. },
  146. ]),
  147. },
  148. },
  149. },
  150. ],
  151. }
  152. let colors = ['#3A92FE', '#01FFFF', '#47FD7F']
  153. let xData = ['0-15km', '15-30km', '30km以上']
  154. let yData = [5, 32, 18]
  155. // 传入数据生成 option
  156. let optionsData = [];
  157. for (let i = 0; i < xData.length; i++) {
  158. optionsData.push(
  159. {
  160. name: xData[i],
  161. value: yData[i],
  162. itemStyle: {
  163. color: colors[i],
  164. }
  165. }
  166. );
  167. }
  168. function getSymbolData(datas) {
  169. let arr = []
  170. for (var i = 0; i < datas.length; i++) {
  171. arr.push({
  172. value: datas[i],
  173. symbolPosition: 'end',
  174. })
  175. }
  176. return arr
  177. }
  178. export const barData = {
  179. backgroundColor: 'rgba(0,0,0,0)',
  180. grid: {
  181. top: 14,
  182. left: 0,
  183. right: 0,
  184. bottom: 7,
  185. containLabel: true,
  186. },
  187. legend: {
  188. show: false
  189. },
  190. xAxis: {
  191. data: ['当前一个小时\n平均到场时间', '预计下个小时\n平均到场时间',],
  192. axisLine: {
  193. lineStyle: {
  194. color: 'rgba(255, 255, 255, 0.2)',
  195. width: 1
  196. },
  197. },
  198. axisTick: {
  199. show: true,
  200. lineStyle: {
  201. color: 'rgba(255, 255, 255, 0.5)'
  202. }
  203. },
  204. axisLabel: {
  205. show: true,
  206. fontSize: 10,
  207. textStyle: {
  208. color: "rgba(255, 255, 255, 0.5)" //X轴文字颜色
  209. }
  210. },
  211. },
  212. yAxis: [
  213. {
  214. type: "value",
  215. splitLine: {
  216. show: true,
  217. lineStyle: {
  218. color: 'rgba(255, 255, 255, 0.2)',
  219. type: 'dashed',
  220. width: 1
  221. },
  222. },
  223. axisTick: { show: false },
  224. axisLine: { show: false },
  225. axisLabel: {
  226. show: true,
  227. fontSize: 16,
  228. textStyle: {
  229. color: "rgba(255, 255, 255, 0.5)" //X轴文字颜色
  230. }
  231. },
  232. },
  233. ],
  234. series: [
  235. {
  236. // 背景系列
  237. type: 'bar',
  238. barGap: '-100%', // 使背景系列与主系列重叠
  239. data: [1, 1, 1, 1, 1, 1, 1], // 所有值为1,表示100%
  240. itemStyle: {
  241. color: 'rgba(255, 255, 255, 0.1)',
  242. borderWidth: 0,
  243. borderColor: '#ccc'
  244. },
  245. barWidth: '100%', // 背景宽度
  246. animation: false
  247. },
  248. {
  249. name: "",
  250. type: "bar",
  251. barWidth: 15,
  252. itemStyle: {
  253. normal: {
  254. color: new echarts.graphic.LinearGradient(0, 1, 0, 0, [{
  255. offset: 0,
  256. color: "#0372FF",
  257. },
  258. {
  259. offset: 1,
  260. color: "#75ECFF",
  261. },
  262. ]),
  263. }
  264. },
  265. showBackground: true,
  266. data: [31, 28,],
  267. label: {
  268. show: false,
  269. },
  270. z: 0,
  271. },
  272. {
  273. type: 'pictorialBar',
  274. symbol: 'react',
  275. symbolSize: [15, 3],
  276. symbolOffset: [0, -2],
  277. z: 12,
  278. itemStyle: {
  279. color: '#FFFFFF',
  280. shadowColor: 'rgba(252, 194, 50, 1)',
  281. shadowBlur: 20,
  282. },
  283. data: getSymbolData([31, 28]),
  284. },
  285. ]
  286. }
  287. export function initBing(optionsData) {
  288. let total = 0
  289. optionsData.map(r=>total+=r.value)
  290. const series = getPie3D(optionsData, 0.8);
  291. series.push({
  292. name: 'pie2d',
  293. type: 'pie',
  294. label: {
  295. opacity: 1,
  296. fontSize: 12,
  297. lineHeight: 20,
  298. textStyle: {
  299. fontSize: 12,
  300. },
  301. },
  302. title:{
  303. text:'x213'
  304. },
  305. labelLine: {
  306. length: 60,
  307. length2: 60,
  308. },
  309. startAngle: -50, //起始角度,支持范围[0, 360]。
  310. clockwise: false, //饼图的扇区是否是顺时针排布。上述这两项配置主要是为了对齐3d的样式
  311. radius: ['0', '0'],
  312. center: ['20%', '20%'],
  313. data: optionsData,
  314. itemStyle: {
  315. opacity: 0,
  316. },
  317. });
  318. // 准备待返回的配置项,把准备好的 legendData、series 传入。
  319. return {
  320. legend: {
  321. tooltip: {
  322. show: true,
  323. },
  324. data: xData,
  325. bottom: '5%',
  326. itemGap: 10,
  327. itemWidth: 7,
  328. itemHeight: 7,
  329. textStyle: {
  330. color: '#fff',
  331. fontSize: 12,
  332. },
  333. },
  334. animation: true,
  335. tooltip: {
  336. formatter: params => {
  337. if (params.seriesName !== 'mouseoutSeries' && params.seriesName !== 'pie2d') {
  338. 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}`;
  339. }
  340. },
  341. textStyle: {
  342. fontSize: 12
  343. },
  344. },
  345. title: {
  346. text: `${total}辆`,
  347. x: 'center',
  348. top: '20',
  349. textStyle: {
  350. color: '#fff',
  351. fontSize: 24,
  352. },
  353. },
  354. backgroundColor: 'rgba(0,0,0,0)',
  355. color:['#3A93FF','#01FFFF','#47FD7F'],
  356. labelLine: {
  357. show: false,
  358. lineStyle: {
  359. color: 'transparent',
  360. },
  361. },
  362. label: {
  363. show: false,
  364. color: 'transparent',
  365. position: 'outside',
  366. formatter: '{b} \n{c} {d}%',
  367. },
  368. xAxis3D: {
  369. min: -1,
  370. max: 1,
  371. },
  372. yAxis3D: {
  373. min: -1,
  374. max: 1,
  375. },
  376. zAxis3D: {
  377. min: -1,
  378. max: 1,
  379. },
  380. grid3D: {
  381. show: false,
  382. boxHeight: 0.05,
  383. top: '5%',
  384. bottom: '15%',
  385. viewControl: {
  386. autoRotate: true, // 自动旋转
  387. zoomSensitivity: 0
  388. },
  389. },
  390. series: series,
  391. };
  392. }
  393. function getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, height) {
  394. // 计算
  395. let midRatio = (startRatio + endRatio) / 2;
  396. let startRadian = startRatio * Math.PI * 2;
  397. let endRadian = endRatio * Math.PI * 2;
  398. let midRadian = midRatio * Math.PI * 2;
  399. // 如果只有一个扇形,则不实现选中效果。
  400. if (startRatio === 0 && endRatio === 1) {
  401. isSelected = false;
  402. }
  403. // 通过扇形内径/外径的值,换算出辅助参数 k(默认值 1/3)
  404. k = typeof k !== 'undefined' ? k : 1 / 3;
  405. // 计算选中效果分别在 x 轴、y 轴方向上的位移(未选中,则位移均为 0)
  406. let offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
  407. let offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
  408. // 计算高亮效果的放大比例(未高亮,则比例为 1)
  409. let hoverRate = isHovered ? 1.05 : 1;
  410. // 返回曲面参数方程
  411. return {
  412. u: {
  413. min: -Math.PI,
  414. max: Math.PI * 3,
  415. step: Math.PI / 32
  416. },
  417. v: {
  418. min: 0,
  419. max: Math.PI * 2,
  420. step: Math.PI / 20
  421. },
  422. x: function (u, v) {
  423. if (u < startRadian) {
  424. return offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
  425. }
  426. if (u > endRadian) {
  427. return offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
  428. }
  429. return offsetX + Math.cos(u) * (1 + Math.cos(v) * k) * hoverRate;
  430. },
  431. y: function (u, v) {
  432. if (u < startRadian) {
  433. return offsetY + Math.sin(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
  434. }
  435. if (u > endRadian) {
  436. return offsetY + Math.sin(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
  437. }
  438. return offsetY + Math.sin(u) * (1 + Math.cos(v) * k) * hoverRate;
  439. },
  440. z: function (u, v) {
  441. if (u < - Math.PI * 0.5) {
  442. return Math.sin(u);
  443. }
  444. if (u > Math.PI * 2.5) {
  445. return Math.sin(u);
  446. }
  447. return Math.sin(v) > 0 ? 2 * height : -1;
  448. }
  449. };
  450. }
  451. // 生成模拟 3D 饼图的配置项
  452. function getPie3D(pieData, internalDiameterRatio) {
  453. let series = [];
  454. let sumValue = 0;
  455. let startValue = 0;
  456. let endValue = 0;
  457. let legendData = [];
  458. let k = typeof internalDiameterRatio !== 'undefined' ? (1 - internalDiameterRatio) / (1 + internalDiameterRatio) : 1 / 3;
  459. // 为每一个饼图数据,生成一个 series-surface 配置
  460. for (let i = 0; i < pieData.length; i++) {
  461. sumValue += pieData[i].value;
  462. let seriesItem = {
  463. name: typeof pieData[i].name === 'undefined' ? `series${i}` : pieData[i].name,
  464. type: 'surface',
  465. parametric: true,
  466. wireframe: {
  467. show: false
  468. },
  469. pieData: pieData[i],
  470. pieStatus: {
  471. selected: false,
  472. hovered: false,
  473. k: k
  474. }
  475. };
  476. if (typeof pieData[i].itemStyle != 'undefined') {
  477. let itemStyle = {};
  478. typeof pieData[i].itemStyle.color != 'undefined' ? itemStyle.color = pieData[i].itemStyle.color : null;
  479. typeof pieData[i].itemStyle.opacity != 'undefined' ? itemStyle.opacity = pieData[i].itemStyle.opacity : null;
  480. seriesItem.itemStyle = itemStyle;
  481. }
  482. series.push(seriesItem);
  483. }
  484. // 使用上一次遍历时,计算出的数据和 sumValue,调用 getParametricEquation 函数,
  485. // 向每个 series-surface 传入不同的参数方程 series-surface.parametricEquation,也就是实现每一个扇形。
  486. for (let i = 0; i < series.length; i++) {
  487. endValue = startValue + series[i].pieData.value;
  488. console.log(series[i]);
  489. series[i].pieData.startRatio = startValue / sumValue;
  490. series[i].pieData.endRatio = endValue / sumValue;
  491. series[i].parametricEquation = getParametricEquation(series[i].pieData.startRatio, series[i].pieData.endRatio, false, false, k, series[i].pieData.value);
  492. startValue = endValue;
  493. legendData.push(series[i].name);
  494. }
  495. // // 补充一个透明的圆环,用于支撑高亮功能的近似实现。
  496. series.push({
  497. name: 'mouseoutSeries',
  498. type: 'surface',
  499. parametric: true,
  500. wireframe: {
  501. show: false,
  502. },
  503. itemStyle: {
  504. opacity: 0.1,
  505. color: '#f0f',
  506. },
  507. parametricEquation: {
  508. u: {
  509. min: 0,
  510. max: Math.PI * 2,
  511. step: Math.PI / 20,
  512. },
  513. v: {
  514. min: 0,
  515. max: Math.PI,
  516. step: Math.PI / 20,
  517. },
  518. x: function (u, v) {
  519. return ((Math.sin(v) * Math.sin(u) + Math.sin(u)) / Math.PI) * 2.1;
  520. },
  521. y: function (u, v) {
  522. return ((Math.sin(v) * Math.cos(u) + Math.cos(u)) / Math.PI) * 2.1;
  523. },
  524. z: function (u, v) {
  525. return Math.cos(v) > 0 ? 0 : -5;
  526. },
  527. },
  528. });
  529. series.push({
  530. name: 'mouseoutSeries',
  531. type: 'surface',
  532. parametric: true,
  533. wireframe: {
  534. show: false,
  535. },
  536. itemStyle: {
  537. opacity: 0.1,
  538. color: '#0ff',
  539. },
  540. parametricEquation: {
  541. u: {
  542. min: 0,
  543. max: Math.PI * 2,
  544. step: Math.PI / 20,
  545. },
  546. v: {
  547. min: 0,
  548. max: Math.PI,
  549. step: Math.PI / 20,
  550. },
  551. x: function (u, v) {
  552. return ((Math.sin(v) * Math.sin(u) + Math.sin(u)) / Math.PI) * 2.1;
  553. },
  554. y: function (u, v) {
  555. return ((Math.sin(v) * Math.cos(u) + Math.cos(u)) / Math.PI) * 2.1;
  556. },
  557. z: function (u, v) {
  558. return Math.cos(v) > 0 ? -15 : -20;
  559. },
  560. },
  561. });
  562. return series;
  563. }
  564. // 进行线的截断
  565. export function initLine(yAxisData, data1, data2, data3) {
  566. // let yAxisData = ['07/01', '07/02', '07/03', '07/04', '07/05', '07/06', '07/07',]
  567. // let data = [100, 90, 200, 250, 240, 500, 120, 390,]
  568. return {
  569. tooltip: {
  570. trigger: 'axis',
  571. axisPointer: {
  572. type: 'shadow',
  573. crossStyle: {
  574. color: '#999'
  575. }
  576. }
  577. },
  578. legend: {
  579. orient: "vertical",
  580. top: "10%",
  581. right: "0%",
  582. itemWidth: 6,
  583. itemHeight: 6,
  584. itemGap: 5,
  585. itemStyle: {
  586. borderRadius: 20, // 设置圆角大
  587. },
  588. icon: "rect",
  589. textStyle: {
  590. fontSize: 10,
  591. color: "#ffffff",
  592. padding: [0, 0, 0, 0],
  593. },
  594. show: false
  595. },
  596. backgroundColor: 'rgba(0,0,0,0)',
  597. grid: {
  598. top: "25%",
  599. right: "5%",
  600. bottom: "15%"
  601. },
  602. xAxis: {
  603. type: 'category',
  604. boundaryGap: true,
  605. axisTick: {
  606. show: false
  607. },
  608. axisLine: {
  609. lineStyle: {
  610. color: '#94A7BD'//轴线和单位颜色
  611. }
  612. },
  613. data: yAxisData
  614. },
  615. yAxis: {
  616. type: 'value',
  617. name: '单位:吨',
  618. axisLine: {
  619. lineStyle: {
  620. color: '#94A7BD'//轴线和单位颜色
  621. }
  622. },
  623. splitLine: {
  624. show: false,
  625. lineStyle: {
  626. show: false,
  627. color: '#182D46',
  628. type: [2, 3],
  629. dashOffset: 2
  630. }
  631. }
  632. },
  633. series: [{
  634. name: '钢铁',
  635. type: 'line',
  636. // symbolSize: 10,
  637. symbol: 'none',
  638. areaStyle: {
  639. color: {
  640. type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
  641. colorStops: [{
  642. offset: 0, color: 'rgba(58, 147, 255, 1)' // 0% 处的颜色
  643. }, {
  644. offset: 1, color: 'rgba(58, 147, 255, 0)' // 100% 处的颜色
  645. }],
  646. global: false // 缺省为 false
  647. },
  648. },
  649. lineStyle: {
  650. color: 'rgba(58, 147, 255, 1)',
  651. width: 2,
  652. type: 'solid'
  653. },
  654. // 最高点标点
  655. data: data1.map(item => {
  656. const maxValue = Math.max(...data1.filter(item => item != '-'))
  657. const minVlaue = Math.min(...data1.filter(item => item != '-'))
  658. if (item === maxValue || item === minVlaue) {
  659. return {
  660. value: item,
  661. symbol: 'circle',
  662. symbolSize: 6,
  663. itemStyle: { color: 'rgba(58, 147, 255, 1)', shadowColor: 'rgba(58, 147, 255,0.6)', shadowBlur: 10 }
  664. }
  665. }
  666. return item
  667. })
  668. }, {
  669. name: '沙石',
  670. type: 'line',
  671. // symbolSize: 10,
  672. symbol: 'none',
  673. areaStyle: {
  674. color: {
  675. type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
  676. colorStops: [{
  677. offset: 0, color: 'rgba(67, 230, 150, 1)' // 0% 处的颜色
  678. }, {
  679. offset: 1, color: 'rgba(67, 230, 150, 0)' // 100% 处的颜色
  680. }],
  681. global: false // 缺省为 false
  682. },
  683. },
  684. lineStyle: {
  685. color: 'rgba(67, 230, 150, 1)',
  686. width: 2,
  687. type: 'solid'
  688. },
  689. // 最高点标点
  690. data: data2.map(item => {
  691. const maxValue = Math.max(...data2.filter(item => item != '-'))
  692. const minVlaue = Math.min(...data2.filter(item => item != '-'))
  693. if (item === maxValue || item === minVlaue) {
  694. return {
  695. value: item,
  696. symbol: 'circle',
  697. symbolSize: 6,
  698. itemStyle: { color: 'rgba(67, 230, 150, 1)', shadowColor: 'rgba(67, 230, 150, 0.6)', shadowBlur: 10 }
  699. }
  700. }
  701. return item != '-' ? item : '-'
  702. })
  703. },
  704. // {
  705. // name: '煤炭',
  706. // type: 'line',
  707. // // symbolSize: 10,
  708. // symbol: 'none',
  709. // areaStyle: {
  710. // color: {
  711. // type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
  712. // colorStops: [{
  713. // offset: 0, color: 'rgba(68,233,150.6)' // 0% 处的颜色
  714. // }, {
  715. // offset: 1, color: 'rgba(68,233,150,0)' // 100% 处的颜色
  716. // }],
  717. // global: false // 缺省为 false
  718. // },
  719. // },
  720. // lineStyle: {
  721. // color: 'rgba(68,233,150,1)',
  722. // width: 2,
  723. // type: 'solid'
  724. // },
  725. // // 最高点标点
  726. // data: data3.map(item => {
  727. // const maxValue = Math.max(...data3.filter(item => item != '-'))
  728. // const minVlaue = Math.min(...data3.filter(item => item != '-'))
  729. // if (item === maxValue || item === minVlaue) {
  730. // return {
  731. // value: item,
  732. // symbol: 'circle',
  733. // symbolSize: 6,
  734. // itemStyle: { color: 'rgba(68,233,150,1)', shadowColor: 'rgba(255,255,255,0.6)', shadowBlur: 10 }
  735. // }
  736. // }
  737. // return item != '-' ? item : '-'
  738. // })
  739. // },
  740. {
  741. name: '石灰石',
  742. type: 'line',
  743. // symbolSize: 10,
  744. symbol: 'none',
  745. areaStyle: {
  746. color: {
  747. type: 'linear', x: 0, y: 0, x2: 0, y2: 1,
  748. colorStops: [{
  749. offset: 0, color: 'rgba(247, 85, 21, 1)' // 0% 处的颜色
  750. }, {
  751. offset: 1, color: 'rgba(247, 85, 21, 0)' // 100% 处的颜色
  752. }],
  753. global: false // 缺省为 false
  754. },
  755. },
  756. lineStyle: {
  757. color: 'rgba(247, 85, 21, 1)',
  758. width: 2,
  759. type: 'solid'
  760. },
  761. // 最高点标点
  762. data: data3.map(item => {
  763. const maxValue = Math.max(...data3.filter(item => item != '-'))
  764. const minVlaue = Math.min(...data3.filter(item => item != '-'))
  765. if (item === maxValue || item === minVlaue) {
  766. return {
  767. value: item,
  768. symbol: 'circle',
  769. symbolSize: 4,
  770. itemStyle: { color: '#rgba(247, 85, 21, 1)', shadowColor: 'rgba(247, 85, 21, 0.6)', shadowBlur: 10 }
  771. }
  772. }
  773. return item != '-' ? item : '-'
  774. })
  775. }]
  776. };
  777. }