echarts.ts 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204
  1. import { ReplaceMode } from '@meta2d/chart-diagram';
  2. //注册所有主题
  3. export function registerTheme() {
  4. fetch('theme/dark.json')
  5. .then((r) => r.json())
  6. .then((theme) => {
  7. echarts.registerTheme('le-dark', theme);
  8. });
  9. }
  10. export function changeTheme(theme: string) {
  11. charts.forEach((item) => {
  12. item.list.forEach((chart) => {
  13. if (chart.data.name === 'echarts') {
  14. chart.data.echarts.theme = theme;
  15. }
  16. });
  17. });
  18. }
  19. export const charts = [
  20. {
  21. name: 'Echarts - 基础图表',
  22. show: true,
  23. list: [
  24. {
  25. name: '折线图',
  26. icon: 'l-line-chart',
  27. data: {
  28. name: 'echarts',
  29. width: 400,
  30. height: 300,
  31. externElement: true,
  32. disableAnchor: true,
  33. echarts: {
  34. option: {
  35. tooltip: {
  36. trigger: 'axis',
  37. },
  38. grid: {
  39. top: 10,
  40. bottom: 20,
  41. left: 40,
  42. right: 5,
  43. },
  44. xAxis: {
  45. type: 'category',
  46. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  47. axisLabel: {
  48. fontSize: 12,
  49. // color: '#ffffff',
  50. },
  51. },
  52. yAxis: {
  53. type: 'value',
  54. axisLabel: {
  55. fontSize: 12,
  56. // color: '#ffffff',
  57. },
  58. },
  59. series: [
  60. {
  61. type: 'line',
  62. data: [820, 932, 901, 934, 1290, 1330, 1320],
  63. },
  64. ],
  65. },
  66. max: 100,
  67. },
  68. realTimes: [
  69. {
  70. key: 'echarts.option.series.0.data',
  71. label: '数据',
  72. type: 'object',
  73. },
  74. {
  75. key: 'echarts.option',
  76. label: 'echarts',
  77. type: 'object',
  78. },
  79. {
  80. key: 'echarts.max',
  81. label: '最大数量',
  82. type: 'number',
  83. },
  84. ],
  85. },
  86. },
  87. {
  88. name: '柱状图',
  89. icon: 'l-bar-chart',
  90. data: {
  91. width: 300,
  92. height: 200,
  93. disableAnchor: true,
  94. externElement: true,
  95. name: 'echarts',
  96. echarts: {
  97. option: {
  98. tooltip: {
  99. trigger: 'axis',
  100. },
  101. grid: {
  102. top: 10,
  103. bottom: 20,
  104. left: 40,
  105. right: 5,
  106. },
  107. xAxis: {
  108. type: 'category',
  109. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  110. axisTick: {
  111. alignWithLabel: true,
  112. },
  113. axisLabel: {
  114. fontSize: 12,
  115. color: '#ffffff',
  116. },
  117. },
  118. yAxis: {
  119. type: 'value',
  120. axisLabel: {
  121. fontSize: 12,
  122. color: '#ffffff',
  123. },
  124. },
  125. series: [
  126. {
  127. name: '直接访问',
  128. type: 'bar',
  129. barWidth: '60%',
  130. label: {
  131. color: '#ffffff',
  132. },
  133. data: [10, 52, 200, 334, 390, 330, 220],
  134. },
  135. ],
  136. },
  137. max: 100,
  138. },
  139. realTimes: [
  140. {
  141. key: 'echarts.option.series.0.data',
  142. label: '数据',
  143. type: 'object',
  144. },
  145. {
  146. key: 'echarts.option',
  147. label: 'echarts',
  148. type: 'object',
  149. },
  150. {
  151. key: 'echarts.max',
  152. label: '最大数量',
  153. type: 'number',
  154. },
  155. ],
  156. },
  157. },
  158. {
  159. name: '饼图',
  160. icon: 'l-pie-chart',
  161. data: {
  162. width: 300,
  163. height: 200,
  164. disableAnchor: true,
  165. externElement: true,
  166. name: 'echarts',
  167. echarts: {
  168. option: {
  169. tooltip: {
  170. trigger: 'item',
  171. },
  172. series: [
  173. {
  174. type: 'pie',
  175. radius: ['50%', '70%'],
  176. label: {
  177. color: '#ffffff',
  178. },
  179. data: [
  180. { value: 335, name: '2D' },
  181. { value: 310, name: '3D' },
  182. { value: 234, name: '大屏' },
  183. { value: 135, name: '物联网平台' },
  184. { value: 1548, name: '图形库' },
  185. ],
  186. },
  187. ],
  188. },
  189. replaceMode: ReplaceMode.Replace,
  190. },
  191. realTimes: [
  192. {
  193. key: 'echarts.option.series.0.data',
  194. label: '数据',
  195. type: 'object',
  196. },
  197. {
  198. key: 'echarts.option',
  199. label: 'echarts',
  200. type: 'object',
  201. },
  202. ],
  203. },
  204. },
  205. {
  206. name: '散点图',
  207. icon: 'l-sandiantu',
  208. data: {
  209. width: 300,
  210. height: 200,
  211. disableAnchor: true,
  212. externElement: true,
  213. name: 'echarts',
  214. echarts: {
  215. option: {
  216. grid: {
  217. top: 10,
  218. bottom: 20,
  219. left: 40,
  220. right: 10,
  221. },
  222. xAxis: {
  223. axisLabel: {
  224. fontSize: 12,
  225. color: '#ffffff',
  226. },
  227. },
  228. yAxis: {
  229. axisLabel: {
  230. fontSize: 12,
  231. color: '#ffffff',
  232. },
  233. },
  234. series: [
  235. {
  236. symbolSize: 10,
  237. data: [
  238. [10.0, 8.04],
  239. [8.07, 6.95],
  240. [13.0, 7.58],
  241. [9.05, 8.81],
  242. [11.0, 8.33],
  243. [14.0, 7.66],
  244. [13.4, 6.81],
  245. [10.0, 6.33],
  246. [14.0, 8.96],
  247. [12.5, 6.82],
  248. [9.15, 7.2],
  249. [11.5, 7.2],
  250. [3.03, 4.23],
  251. [12.2, 7.83],
  252. [2.02, 4.47],
  253. [1.05, 3.33],
  254. [4.05, 4.96],
  255. [6.03, 7.24],
  256. [12.0, 6.26],
  257. [12.0, 8.84],
  258. [7.08, 5.82],
  259. [5.02, 5.68],
  260. ],
  261. type: 'scatter',
  262. },
  263. ],
  264. },
  265. replaceMode: ReplaceMode.Replace,
  266. },
  267. realTimes: [
  268. {
  269. key: 'echarts.option.series.0.data',
  270. label: '数据',
  271. type: 'object',
  272. },
  273. {
  274. key: 'echarts.option',
  275. label: 'echarts',
  276. type: 'object',
  277. },
  278. ],
  279. },
  280. },
  281. {
  282. name: 'K线图',
  283. icon: 'l-kxiantu',
  284. data: {
  285. width: 300,
  286. height: 200,
  287. disableAnchor: true,
  288. externElement: true,
  289. name: 'echarts',
  290. echarts: {
  291. option: {
  292. grid: {
  293. top: 20,
  294. bottom: 30,
  295. left: 40,
  296. right: 10,
  297. },
  298. xAxis: {
  299. axisLabel: {
  300. fontSize: 12,
  301. color: '#ffffff',
  302. },
  303. data: ['2017-10-24', '2017-10-25', '2017-10-26', '2017-10-27'],
  304. },
  305. yAxis: {
  306. axisLabel: {
  307. fontSize: 12,
  308. color: '#ffffff',
  309. },
  310. },
  311. series: [
  312. {
  313. type: 'candlestick',
  314. data: [
  315. [20, 34, 10, 38],
  316. [40, 35, 30, 50],
  317. [31, 38, 33, 44],
  318. [38, 15, 5, 42],
  319. ],
  320. },
  321. ],
  322. },
  323. replaceMode: ReplaceMode.Replace,
  324. },
  325. realTimes: [
  326. {
  327. key: 'echarts.option.series.0.data',
  328. label: '数据',
  329. type: 'object',
  330. },
  331. {
  332. key: 'echarts.option',
  333. label: 'echarts',
  334. type: 'object',
  335. },
  336. ],
  337. },
  338. },
  339. {
  340. name: '雷达图',
  341. icon: 'l-leidatu',
  342. data: {
  343. width: 300,
  344. height: 200,
  345. disableAnchor: true,
  346. externElement: true,
  347. name: 'echarts',
  348. echarts: {
  349. option: {
  350. grid: {
  351. top: 20,
  352. bottom: 30,
  353. left: 40,
  354. right: 10,
  355. },
  356. radar: {
  357. // shape: 'circle',
  358. indicator: [
  359. { name: 'Sales', max: 6500 },
  360. { name: 'Administration', max: 16000 },
  361. { name: 'Information Technology', max: 30000 },
  362. { name: 'Customer Support', max: 38000 },
  363. { name: 'Development', max: 52000 },
  364. { name: 'Marketing', max: 25000 },
  365. ],
  366. },
  367. series: [
  368. {
  369. name: 'Budget vs spending',
  370. type: 'radar',
  371. data: [
  372. {
  373. value: [4200, 3000, 20000, 35000, 50000, 18000],
  374. name: 'Allocated Budget',
  375. },
  376. {
  377. value: [5000, 14000, 28000, 26000, 42000, 21000],
  378. name: 'Actual Spending',
  379. },
  380. ],
  381. },
  382. ],
  383. },
  384. replaceMode: ReplaceMode.Replace,
  385. },
  386. realTimes: [
  387. {
  388. key: 'echarts.option.series.0.data',
  389. label: '数据',
  390. type: 'object',
  391. },
  392. {
  393. key: 'echarts.option',
  394. label: 'echarts',
  395. type: 'object',
  396. },
  397. ],
  398. },
  399. },
  400. {
  401. name: '旭日图',
  402. icon: 'l-xuritu',
  403. data: {
  404. width: 200,
  405. height: 200,
  406. disableAnchor: true,
  407. externElement: true,
  408. name: 'echarts',
  409. echarts: {
  410. option: {
  411. series: [
  412. {
  413. radius: ['15%', '80%'],
  414. type: 'sunburst',
  415. data: [
  416. {
  417. children: [
  418. {
  419. value: 5,
  420. children: [
  421. {
  422. value: 1,
  423. itemStyle: {
  424. color: '#F54F4A',
  425. },
  426. },
  427. {
  428. value: 2,
  429. children: [
  430. {
  431. value: 1,
  432. itemStyle: {
  433. color: '#FF8C75',
  434. },
  435. },
  436. ],
  437. },
  438. {
  439. children: [
  440. {
  441. value: 1,
  442. },
  443. ],
  444. },
  445. ],
  446. itemStyle: {
  447. color: '#F54F4A',
  448. },
  449. },
  450. {
  451. value: 10,
  452. children: [
  453. {
  454. value: 6,
  455. children: [
  456. {
  457. value: 1,
  458. itemStyle: {
  459. color: '#F54F4A',
  460. },
  461. },
  462. {
  463. value: 1,
  464. },
  465. {
  466. value: 1,
  467. itemStyle: {
  468. color: '#FF8C75',
  469. },
  470. },
  471. {
  472. value: 1,
  473. },
  474. ],
  475. itemStyle: {
  476. color: '#FFB499',
  477. },
  478. },
  479. {
  480. value: 2,
  481. children: [
  482. {
  483. value: 1,
  484. },
  485. ],
  486. itemStyle: {
  487. color: '#FFB499',
  488. },
  489. },
  490. {
  491. children: [
  492. {
  493. value: 1,
  494. itemStyle: {
  495. color: '#FF8C75',
  496. },
  497. },
  498. ],
  499. },
  500. ],
  501. itemStyle: {
  502. color: '#F54F4A',
  503. },
  504. },
  505. ],
  506. itemStyle: {
  507. color: '#F54F4A',
  508. },
  509. },
  510. {
  511. value: 9,
  512. children: [
  513. {
  514. value: 4,
  515. children: [
  516. {
  517. value: 2,
  518. itemStyle: {
  519. color: '#FF8C75',
  520. },
  521. },
  522. {
  523. children: [
  524. {
  525. value: 1,
  526. itemStyle: {
  527. color: '#F54F4A',
  528. },
  529. },
  530. ],
  531. },
  532. ],
  533. itemStyle: {
  534. color: '#F54F4A',
  535. },
  536. },
  537. {
  538. children: [
  539. {
  540. value: 3,
  541. children: [
  542. {
  543. value: 1,
  544. },
  545. {
  546. value: 1,
  547. itemStyle: {
  548. color: '#FF8C75',
  549. },
  550. },
  551. ],
  552. },
  553. ],
  554. itemStyle: {
  555. color: '#FFB499',
  556. },
  557. },
  558. ],
  559. itemStyle: {
  560. color: '#FF8C75',
  561. },
  562. },
  563. {
  564. value: 7,
  565. children: [
  566. {
  567. children: [
  568. {
  569. value: 1,
  570. itemStyle: {
  571. color: '#FFB499',
  572. },
  573. },
  574. {
  575. value: 3,
  576. children: [
  577. {
  578. value: 1,
  579. itemStyle: {
  580. color: '#FF8C75',
  581. },
  582. },
  583. {
  584. value: 1,
  585. },
  586. ],
  587. itemStyle: {
  588. color: '#FF8C75',
  589. },
  590. },
  591. {
  592. value: 2,
  593. children: [
  594. {
  595. value: 1,
  596. },
  597. {
  598. value: 1,
  599. itemStyle: {
  600. color: '#F54F4A',
  601. },
  602. },
  603. ],
  604. itemStyle: {
  605. color: '#F54F4A',
  606. },
  607. },
  608. ],
  609. itemStyle: {
  610. color: '#FFB499',
  611. },
  612. },
  613. ],
  614. itemStyle: {
  615. color: '#F54F4A',
  616. },
  617. },
  618. {
  619. children: [
  620. {
  621. value: 6,
  622. children: [
  623. {
  624. value: 1,
  625. itemStyle: {
  626. color: '#FF8C75',
  627. },
  628. },
  629. {
  630. value: 2,
  631. children: [
  632. {
  633. value: 2,
  634. itemStyle: {
  635. color: '#FF8C75',
  636. },
  637. },
  638. ],
  639. itemStyle: {
  640. color: '#F54F4A',
  641. },
  642. },
  643. {
  644. value: 1,
  645. itemStyle: {
  646. color: '#FFB499',
  647. },
  648. },
  649. ],
  650. itemStyle: {
  651. color: '#FFB499',
  652. },
  653. },
  654. {
  655. value: 3,
  656. children: [
  657. {
  658. value: 1,
  659. },
  660. {
  661. children: [
  662. {
  663. value: 1,
  664. itemStyle: {
  665. color: '#FF8C75',
  666. },
  667. },
  668. ],
  669. },
  670. {
  671. value: 1,
  672. },
  673. ],
  674. itemStyle: {
  675. color: '#FFB499',
  676. },
  677. },
  678. ],
  679. itemStyle: {
  680. color: '#F54F4A',
  681. },
  682. },
  683. ],
  684. label: {
  685. rotate: 'radial',
  686. color: '#ffffff',
  687. },
  688. },
  689. ],
  690. },
  691. replaceMode: ReplaceMode.Replace,
  692. },
  693. realTimes: [
  694. {
  695. key: 'echarts.option.series.0.data',
  696. label: '数据',
  697. type: 'object',
  698. },
  699. {
  700. key: 'echarts.option',
  701. label: 'echarts',
  702. type: 'object',
  703. },
  704. ],
  705. },
  706. },
  707. {
  708. name: '桑基图',
  709. icon: 'l-sangshentu',
  710. data: {
  711. width: 300,
  712. height: 200,
  713. disableAnchor: true,
  714. externElement: true,
  715. name: 'echarts',
  716. echarts: {
  717. option: {
  718. series: {
  719. type: 'sankey',
  720. layout: 'none',
  721. emphasis: {
  722. focus: 'adjacency',
  723. },
  724. data: [
  725. {
  726. name: 'a',
  727. },
  728. {
  729. name: 'b',
  730. },
  731. {
  732. name: 'a1',
  733. },
  734. {
  735. name: 'a2',
  736. },
  737. {
  738. name: 'b1',
  739. },
  740. {
  741. name: 'c',
  742. },
  743. ],
  744. links: [
  745. {
  746. source: 'a',
  747. target: 'a1',
  748. value: 5,
  749. },
  750. {
  751. source: 'a',
  752. target: 'a2',
  753. value: 3,
  754. },
  755. {
  756. source: 'b',
  757. target: 'b1',
  758. value: 8,
  759. },
  760. {
  761. source: 'a',
  762. target: 'b1',
  763. value: 3,
  764. },
  765. {
  766. source: 'b1',
  767. target: 'a1',
  768. value: 1,
  769. },
  770. {
  771. source: 'b1',
  772. target: 'c',
  773. value: 2,
  774. },
  775. ],
  776. lineStyle: {
  777. color: 'source',
  778. curveness: 0.5,
  779. },
  780. label: {
  781. color: '#ffffff',
  782. fontSize: 10,
  783. },
  784. },
  785. },
  786. replaceMode: ReplaceMode.Replace,
  787. },
  788. realTimes: [
  789. {
  790. key: 'echarts.option.series.0.data',
  791. label: '数据',
  792. type: 'object',
  793. },
  794. {
  795. key: 'echarts.option',
  796. label: 'echarts',
  797. type: 'object',
  798. },
  799. ],
  800. },
  801. },
  802. {
  803. name: '漏斗图',
  804. icon: 'l-loudoutu',
  805. data: {
  806. width: 200,
  807. height: 200,
  808. disableAnchor: true,
  809. externElement: true,
  810. name: 'echarts',
  811. echarts: {
  812. option: {
  813. tooltip: {
  814. trigger: 'item',
  815. formatter: '{a} <br/>{b} : {c}%',
  816. },
  817. series: [
  818. {
  819. name: 'Expected',
  820. type: 'funnel',
  821. left: '2%',
  822. width: '80%',
  823. label: {
  824. color: '#ffffff',
  825. formatter: '{b}Expected',
  826. },
  827. labelLine: {
  828. show: false,
  829. },
  830. itemStyle: {
  831. opacity: 0.7,
  832. },
  833. emphasis: {
  834. label: {
  835. position: 'inside',
  836. formatter: '{b}Expected: {c}%',
  837. },
  838. },
  839. data: [
  840. { value: 60, name: 'Visit' },
  841. { value: 40, name: 'Inquiry' },
  842. { value: 20, name: 'Order' },
  843. { value: 80, name: 'Click' },
  844. { value: 100, name: 'Show' },
  845. ],
  846. },
  847. {
  848. name: 'Actual',
  849. type: 'funnel',
  850. left: '2%',
  851. width: '80%',
  852. maxSize: '80%',
  853. label: {
  854. position: 'inside',
  855. formatter: '{c}%',
  856. color: '#fff',
  857. },
  858. itemStyle: {
  859. opacity: 0.5,
  860. borderColor: '#fff',
  861. borderWidth: 2,
  862. },
  863. emphasis: {
  864. label: {
  865. position: 'inside',
  866. formatter: '{b}Actual: {c}%',
  867. },
  868. },
  869. data: [
  870. { value: 30, name: 'Visit' },
  871. { value: 10, name: 'Inquiry' },
  872. { value: 5, name: 'Order' },
  873. { value: 50, name: 'Click' },
  874. { value: 80, name: 'Show' },
  875. ],
  876. z: 100,
  877. },
  878. ],
  879. },
  880. replaceMode: ReplaceMode.Replace,
  881. },
  882. realTimes: [
  883. {
  884. key: 'echarts.option.series.0.data',
  885. label: '数据',
  886. type: 'object',
  887. },
  888. {
  889. key: 'echarts.option',
  890. label: 'echarts',
  891. type: 'object',
  892. },
  893. ],
  894. },
  895. },
  896. {
  897. name: '仪表盘',
  898. icon: 'l-dashboard-chart',
  899. data: {
  900. width: 200,
  901. height: 200,
  902. disableAnchor: true,
  903. externElement: true,
  904. name: 'echarts',
  905. echarts: {
  906. option: {
  907. tooltip: {
  908. formatter: '{a} <br/>{b} : {c}%',
  909. },
  910. series: [
  911. {
  912. type: 'gauge',
  913. axisLine: {
  914. roundCap: true,
  915. },
  916. progress: {
  917. show: true,
  918. roundCap: true,
  919. },
  920. data: [{ value: 70 }],
  921. },
  922. ],
  923. },
  924. replaceMode: ReplaceMode.Replace,
  925. },
  926. realTimes: [
  927. {
  928. key: 'echarts.option.series.0.data',
  929. label: '数据',
  930. type: 'object',
  931. },
  932. {
  933. key: 'echarts.option',
  934. label: 'echarts',
  935. type: 'object',
  936. },
  937. ],
  938. },
  939. },
  940. ],
  941. },
  942. {
  943. name: '乐吾乐Charts',
  944. show: true,
  945. list: [
  946. {
  947. name: '折线图',
  948. icon: 'l-line-chart',
  949. data: {
  950. name: 'lineChart',
  951. width: 400,
  952. disableAnchor: true,
  953. height: 200,
  954. chartsColor: [
  955. '#1890ff',
  956. '#2FC25B',
  957. '#FACC14',
  958. '#c23531',
  959. '#2f4554',
  960. '#61a0a8',
  961. '#d48265',
  962. ],
  963. xAxisData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  964. smooth: true,
  965. data: [
  966. [1820, 1932, 1901, 1934, 1990, 1830, 1920],
  967. [1710, 1932, 1901, 1834, 1700, 1830, 1720],
  968. ],
  969. },
  970. },
  971. {
  972. name: '柱状图',
  973. icon: 'l-bar-chart',
  974. data: {
  975. name: 'histogram',
  976. x: 600,
  977. y: 100,
  978. width: 400,
  979. height: 200,
  980. disableAnchor: true,
  981. chartsColor: [
  982. '#1890ff',
  983. '#2FC25B',
  984. '#FACC14',
  985. '#c23531',
  986. '#2f4554',
  987. '#61a0a8',
  988. '#d48265',
  989. ],
  990. xAxisData: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
  991. data: [
  992. [120, 200, 150, 80, 70, 110, 130],
  993. [140, 250, 150, 80, 60, 10, 30],
  994. [40, 50, 180, 210, 60, 70, 30],
  995. ],
  996. },
  997. },
  998. {
  999. name: '饼图',
  1000. icon: 'l-pie-chart',
  1001. data: {
  1002. name: 'pieChart',
  1003. x: 100,
  1004. y: 300,
  1005. width: 400,
  1006. height: 200,
  1007. disableAnchor: true,
  1008. chartsColor: [
  1009. '#1890ff',
  1010. '#36CBCB',
  1011. '#2FC25B',
  1012. '#FACC14',
  1013. '#F2637B',
  1014. '#fc8452',
  1015. '#9a60b4',
  1016. '#ea7ccc',
  1017. ],
  1018. data: [
  1019. [
  1020. { value: 1048, name: 'Search Engine' },
  1021. { value: 735, name: 'Direct' },
  1022. { value: 580, name: 'Email' },
  1023. { value: 484, name: 'Union Ads' },
  1024. { value: 300, name: 'Video Ads' },
  1025. ],
  1026. [
  1027. { value: 1548, name: 'Search' },
  1028. { value: 775, name: 'Direct' },
  1029. { value: 679, name: 'Market' },
  1030. ],
  1031. ],
  1032. chartsRadius: [
  1033. ['60%', '70%'],
  1034. ['0%', '50%'],
  1035. ],
  1036. },
  1037. },
  1038. {
  1039. name: '仪表盘',
  1040. icon: 'l-dashboard-chart',
  1041. data: {
  1042. name: 'gauge',
  1043. x: 600,
  1044. y: 300,
  1045. width: 400,
  1046. height: 400,
  1047. disableAnchor: true,
  1048. value: 90,
  1049. unit: 'm/s',
  1050. axisLine: [
  1051. [0.3, '#67e0e3'],
  1052. [0.7, '#37a2da'],
  1053. [1, '#fd666d'],
  1054. ],
  1055. animateCycle: 1,
  1056. keepAnimateState: 0,
  1057. },
  1058. },
  1059. {
  1060. name: '时钟',
  1061. icon: 'l-07',
  1062. data: {
  1063. name: 'gauge',
  1064. x: 600,
  1065. y: 300,
  1066. width: 400,
  1067. height: 400,
  1068. disableAnchor: true,
  1069. isClock: true,
  1070. startAngle: 90,
  1071. endAngle: -270,
  1072. min: 0,
  1073. max: 12,
  1074. splitNumber: 12,
  1075. background: '#3A3A3A',
  1076. color: '#C0911F',
  1077. },
  1078. },
  1079. ],
  1080. },
  1081. {
  1082. name: '折线图',
  1083. show: true,
  1084. list: [
  1085. {
  1086. name: '基础折线图',
  1087. icon: 'l-line-chart',
  1088. data: {
  1089. name: 'echarts',
  1090. width: 366,
  1091. height: 206,
  1092. externElement: true,
  1093. disableAnchor: true,
  1094. echarts: {
  1095. option: {
  1096. grid: {
  1097. top: 20,
  1098. bottom: 40,
  1099. left: 40,
  1100. right: 20,
  1101. },
  1102. xAxis: {
  1103. type: 'category',
  1104. data: ['1月', '2月', '3月', '4月', '5月', '6月'],
  1105. },
  1106. yAxis: {
  1107. type: 'value',
  1108. max: 100,
  1109. min: 0,
  1110. interval: 50,
  1111. },
  1112. series: [
  1113. {
  1114. type: 'line',
  1115. data: [40, 20, 90, 60, 70, 80],
  1116. },
  1117. ],
  1118. },
  1119. max: 100,
  1120. },
  1121. realTimes: [
  1122. {
  1123. key: 'echarts.option.series.0.data',
  1124. label: '数据',
  1125. type: 'object',
  1126. },
  1127. {
  1128. key: 'echarts.option',
  1129. label: 'echarts',
  1130. type: 'object',
  1131. },
  1132. {
  1133. key: 'echarts.max',
  1134. label: '最大数量',
  1135. type: 'number',
  1136. },
  1137. ],
  1138. },
  1139. },
  1140. {
  1141. name: '双折线图',
  1142. icon: 'l-line-chart',
  1143. data: {
  1144. name: 'echarts',
  1145. width: 366,
  1146. height: 206,
  1147. externElement: true,
  1148. disableAnchor: true,
  1149. echarts: {
  1150. option: {
  1151. grid: {
  1152. top: 20,
  1153. bottom: 40,
  1154. left: 40,
  1155. right: 20,
  1156. },
  1157. xAxis: {
  1158. type: 'category',
  1159. data: ['1月', '2月', '3月', '4月', '5月', '6月'],
  1160. },
  1161. yAxis: {
  1162. type: 'value',
  1163. max: 100,
  1164. min: 0,
  1165. interval: 50,
  1166. },
  1167. series: [
  1168. {
  1169. type: 'line',
  1170. data: [40, 35, 80, 40, 45, 25],
  1171. },
  1172. {
  1173. type: 'line',
  1174. data: [25, 40, 20, 30, 25, 40],
  1175. },
  1176. ],
  1177. },
  1178. max: 100,
  1179. },
  1180. realTimes: [
  1181. {
  1182. key: 'echarts.option.series.0.data',
  1183. label: '数据',
  1184. type: 'object',
  1185. },
  1186. {
  1187. key: 'echarts.option',
  1188. label: 'echarts',
  1189. type: 'object',
  1190. },
  1191. {
  1192. key: 'echarts.max',
  1193. label: '最大数量',
  1194. type: 'number',
  1195. },
  1196. ],
  1197. },
  1198. },
  1199. ],
  1200. },
  1201. ];