echartOption.ts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305
  1. import * as echarts from 'echarts';
  2. export function homePieOption() {
  3. return {
  4. legend: {
  5. show: false
  6. },
  7. tooltip: {
  8. trigger: 'item',
  9. position: 'right'
  10. },
  11. grid: { left: '0%' },
  12. graphic: [
  13. {
  14. //环形图中间添加文字
  15. type: 'text', //通过不同top值可以设置上下显示
  16. left: '35%',
  17. top: '45%',
  18. style: {
  19. text: `总数`,
  20. textAlign: 'center',
  21. fontSize: 20,
  22. lineHeight: 20
  23. }
  24. }
  25. ],
  26. series: [
  27. {
  28. name: 'Access From',
  29. type: 'pie',
  30. radius: ['55%', '75%'],
  31. center: ['45%', '50%'],
  32. avoidLabelOverlap: false,
  33. itemStyle: {
  34. borderColor: 'rgb(232, 239, 255)',
  35. borderWidth: 2
  36. },
  37. label: {
  38. show: false,
  39. position: 'center'
  40. },
  41. emphasis: {
  42. label: {
  43. show: false,
  44. fontSize: 10,
  45. fontWeight: 'bold'
  46. }
  47. },
  48. data: [
  49. { value: 1048, name: '本平台发布服务' },
  50. { value: 735, name: '第三方注册服务' },
  51. { value: 580, name: '第三方发布服务' }
  52. ]
  53. },
  54. {
  55. data: [{ value: 10, name: '' }],
  56. type: 'pie',
  57. radius: ['75%', '90%'],
  58. center: ['45%', '50%'],
  59. avoidLabelOverlap: false,
  60. tooltip: {
  61. show: false
  62. },
  63. label: {
  64. show: false
  65. },
  66. itemStyle: {
  67. color: 'rgb(232, 239, 255)'
  68. }
  69. }
  70. ]
  71. };
  72. }
  73. export function homeLineOption() {
  74. return {
  75. legend: {
  76. orient: 'vertical',
  77. top: 0,
  78. right: 0,
  79. icon: 'roundRect',
  80. itemWidth: 15,
  81. itemHeight: 10,
  82. textStyle: {
  83. fontSize: 10
  84. }
  85. },
  86. xAxis: {
  87. type: 'category',
  88. axisTick: {
  89. show: false
  90. },
  91. axisLine: {
  92. show: false
  93. },
  94. splitLine: {
  95. show: false
  96. },
  97. data: ['1', '2', '3', '4', '5', '6', '7']
  98. },
  99. yAxis: {
  100. type: 'value',
  101. axisTick: {
  102. show: false
  103. },
  104. splitLine: {
  105. show: false
  106. },
  107. axisLine: {
  108. show: false
  109. }
  110. },
  111. grid: {
  112. left: 30,
  113. top: 60,
  114. right: 0,
  115. bottom: 30
  116. },
  117. series: [
  118. {
  119. data: [62, 93, 40, 53, 96, 73, 22],
  120. type: 'line',
  121. smooth: true,
  122. symbolSize: 0,
  123. name: '服务新增统计',
  124. areaStyle: {
  125. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  126. {
  127. offset: 0,
  128. color: 'rgba(45,229,168,0.8)'
  129. },
  130. {
  131. offset: 1,
  132. color: 'rgba(45,229,168,0.3)'
  133. }
  134. ])
  135. }
  136. },
  137. {
  138. data: [72, 98, 30, 67, 89, 60, 32],
  139. type: 'line',
  140. smooth: true,
  141. symbolSize: 0,
  142. name: '服务共享统计',
  143. areaStyle: {
  144. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  145. {
  146. offset: 0,
  147. color: 'rgba(34,154,253,0.8)'
  148. },
  149. {
  150. offset: 1,
  151. color: 'rgba(34,154,253,0.3)'
  152. }
  153. ])
  154. }
  155. }
  156. ]
  157. };
  158. }
  159. export function homeCategoryOption() {
  160. return {
  161. grid: {
  162. left: 30,
  163. top: 30,
  164. bottom: 25,
  165. right: 10
  166. },
  167. xAxis: {
  168. axisTick: {
  169. show: false
  170. },
  171. axisLine: {
  172. show: false
  173. },
  174. splitLine: {
  175. show: false
  176. },
  177. type: 'category',
  178. data: ['基本功能', '定位工具', '地图洒点', '地图查询', '特效工具', '地图事件', '地图应用']
  179. },
  180. yAxis: {
  181. axisTick: {
  182. show: false
  183. },
  184. axisLine: {
  185. show: false
  186. },
  187. splitLine: {
  188. show: true,
  189. lineStyle: {
  190. type: 'dashed'
  191. }
  192. },
  193. type: 'value'
  194. },
  195. series: [
  196. {
  197. data: [120, 200, 150, 80, 70, 110, 130],
  198. type: 'bar',
  199. barWidth: 10,
  200. itemStyle: {
  201. color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
  202. {
  203. offset: 0,
  204. color: '#349afe'
  205. },
  206. {
  207. offset: 1,
  208. color: '#e7f3ff'
  209. }
  210. ])
  211. }
  212. }
  213. ]
  214. };
  215. }
  216. export function inspectPieOption() {
  217. return {
  218. legend: {
  219. show: false
  220. },
  221. tooltip: {
  222. trigger: 'item',
  223. position: 'right'
  224. },
  225. grid: { left: '0%' },
  226. graphic: [
  227. {
  228. //环形图中间添加文字
  229. type: 'text', //通过不同top值可以设置上下显示
  230. left: '31%',
  231. top: '35%',
  232. style: {
  233. text: `总数据`,
  234. textAlign: 'center',
  235. fontSize: 14,
  236. lineHeight: 20
  237. }
  238. },
  239. {
  240. //环形图中间添加文字
  241. type: 'text', //通过不同top值可以设置上下显示
  242. left: '36%',
  243. top: '50%',
  244. style: {
  245. text: `260`,
  246. textAlign: 'center',
  247. fontSize: 18,
  248. lineHeight: 20
  249. }
  250. }
  251. ],
  252. series: [
  253. {
  254. name: 'Access From',
  255. type: 'pie',
  256. radius: ['55%', '75%'],
  257. center: ['45%', '50%'],
  258. avoidLabelOverlap: false,
  259. itemStyle: {
  260. borderColor: 'rgb(232, 239, 255)',
  261. borderWidth: 2
  262. },
  263. label: {
  264. show: false,
  265. position: 'center'
  266. },
  267. emphasis: {
  268. label: {
  269. show: false,
  270. fontSize: 10,
  271. fontWeight: 'bold'
  272. }
  273. },
  274. data: [
  275. { value: 1048, name: '本平台发布服务' },
  276. { value: 735, name: '第三方注册服务' },
  277. { value: 580, name: '第三方发布服务' }
  278. ]
  279. },
  280. {
  281. data: [{ value: 10, name: '' }],
  282. type: 'pie',
  283. radius: ['75%', '90%'],
  284. center: ['45%', '50%'],
  285. avoidLabelOverlap: false,
  286. tooltip: {
  287. show: false
  288. },
  289. label: {
  290. show: false
  291. },
  292. itemStyle: {
  293. color: 'rgb(232, 239, 255)'
  294. }
  295. }
  296. ]
  297. };
  298. }