TianluEngin.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399
  1. <template>
  2. <div class="Chart">
  3. <div class="fonts">
  4. 100%
  5. </div>
  6. <div class="bottomFonts">
  7. 道路通达率
  8. </div>
  9. </div>
  10. <div class="text">
  11. <div class="left">
  12. <div class="leftTop">11.2km</div>
  13. <div class="leftMid">田路总长度</div>
  14. <div class="leftTop">0.8km</div>
  15. <div class="leftMid">机耕路长度</div>
  16. </div>
  17. <div class="right">
  18. <div class="rightTop">1.8km</div>
  19. <div class="rightMid">主路长度</div>
  20. <div class="rightTop">0.4km</div>
  21. <div class="rightMid">生产路长度</div>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. option: {},
  30. value: 50,
  31. angle: 30
  32. }
  33. },
  34. created() {
  35. },
  36. mounted() {
  37. },
  38. methods: {
  39. /* getCirlPoint(x0, y0, r, angle) {
  40. let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
  41. let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
  42. return {
  43. x: x1,
  44. y: y1
  45. }
  46. },
  47. typeCharts() {
  48. this.option = this.getOption();
  49. // var chartDom = document.getElementById('echarts');
  50. // var myChart = echarts.init(chartDom);
  51. // myChart.setOption(option, true);
  52. },
  53. getOption(data) {
  54. let angle = 30;
  55. let option = {
  56. title: {
  57. text: '{a|' + '企业' + '}',
  58. x: 'center',
  59. y: 'center',
  60. textStyle: {
  61. rich: {
  62. a: {
  63. fontSize: 20,
  64. color: '#29EEF3'
  65. },
  66. c: {
  67. fontSize: 16,
  68. color: '#ffffff',
  69. // padding: [5,0]
  70. }
  71. }
  72. }
  73. },
  74. series: [{
  75. name: "ring5",
  76. type: 'custom',
  77. coordinateSystem: "none",
  78. renderItem: function(params, api) {
  79. return {
  80. type: 'arc',
  81. shape: {
  82. cx: api.getWidth() / 2,
  83. cy: api.getHeight() / 2,
  84. r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
  85. startAngle: (0 + angle) * Math.PI / 180,
  86. endAngle: (90 + angle) * Math.PI / 180
  87. },
  88. style: {
  89. stroke: "#0CD3DB",
  90. fill: "transparent",
  91. lineWidth: 1.5
  92. },
  93. silent: true
  94. };
  95. },
  96. data: [0]
  97. },
  98. {
  99. name: "ring5",
  100. type: 'custom',
  101. coordinateSystem: "none",
  102. renderItem: function(params, api) {
  103. return {
  104. type: 'arc',
  105. shape: {
  106. cx: api.getWidth() / 2,
  107. cy: api.getHeight() / 2,
  108. r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
  109. startAngle: (180 + angle) * Math.PI / 180,
  110. endAngle: (270 + angle) * Math.PI / 180
  111. },
  112. style: {
  113. stroke: "#0CD3DB",
  114. fill: "transparent",
  115. lineWidth: 1.5
  116. },
  117. silent: true
  118. };
  119. },
  120. data: [0]
  121. },
  122. {
  123. name: "ring5",
  124. type: 'custom',
  125. coordinateSystem: "none",
  126. renderItem: function(params, api) {
  127. return {
  128. type: 'arc',
  129. shape: {
  130. cx: api.getWidth() / 2,
  131. cy: api.getHeight() / 2,
  132. r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75,
  133. startAngle: (270 + -angle) * Math.PI / 180,
  134. endAngle: (40 + -angle) * Math.PI / 180
  135. },
  136. style: {
  137. stroke: "#0CD3DB",
  138. fill: "transparent",
  139. lineWidth: 1.5
  140. },
  141. silent: true
  142. };
  143. },
  144. data: [0]
  145. },
  146. {
  147. name: "ring5",
  148. type: 'custom',
  149. coordinateSystem: "none",
  150. renderItem: function(params, api) {
  151. return {
  152. type: 'arc',
  153. shape: {
  154. cx: api.getWidth() / 2,
  155. cy: api.getHeight() / 2,
  156. r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75,
  157. startAngle: (90 + -angle) * Math.PI / 180,
  158. endAngle: (220 + -angle) * Math.PI / 180
  159. },
  160. style: {
  161. stroke: "#0CD3DB",
  162. fill: "transparent",
  163. lineWidth: 1.5
  164. },
  165. silent: true
  166. };
  167. },
  168. data: [0]
  169. },
  170. {
  171. name: "ring5",
  172. type: 'custom',
  173. coordinateSystem: "none",
  174. renderItem: function(params, api) {
  175. let x0 = api.getWidth() / 2;
  176. let y0 = api.getHeight() / 2;
  177. let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75;
  178. let point = {
  179. x:30,
  180. y:40
  181. }
  182. return {
  183. type: 'circle',
  184. shape: {
  185. cx: point.x,
  186. cy: point.y,
  187. r: 4
  188. },
  189. style: {
  190. stroke: "#0CD3DB", //粉
  191. fill: "#0CD3DB"
  192. },
  193. silent: true
  194. };
  195. },
  196. data: [0]
  197. },
  198. {
  199. name: "ring5", //绿点
  200. type: 'custom',
  201. coordinateSystem: "none",
  202. renderItem: function(params, api) {
  203. let x0 = api.getWidth() / 2;
  204. let y0 = api.getHeight() / 2;
  205. let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75;
  206. let point = {
  207. x:30,
  208. y:40
  209. }
  210. return {
  211. type: 'circle',
  212. shape: {
  213. cx: point.x,
  214. cy: point.y,
  215. r: 4
  216. },
  217. style: {
  218. stroke: "#0CD3DB", //绿
  219. fill: "#0CD3DB"
  220. },
  221. silent: true
  222. };
  223. },
  224. data: [0]
  225. },
  226. {
  227. name: '覆盖率',
  228. type: 'pie',
  229. radius: ['58%', '45%'],
  230. silent: true,
  231. clockwise: true,
  232. startAngle: 90,
  233. z: 0,
  234. zlevel: 0,
  235. label: {
  236. normal: {
  237. position: "center",
  238. }
  239. },
  240. data: [{
  241. value: 79,
  242. name: "",
  243. itemStyle: {
  244. normal: {
  245. color: { // 完成的圆环的颜色
  246. colorStops: [{
  247. offset: 0,
  248. color: '#4FADFD' // 0% 处的颜色
  249. }, {
  250. offset: 1,
  251. color: '#28E8FA' // 100% 处的颜色
  252. }]
  253. },
  254. }
  255. }
  256. },
  257. {
  258. value: 100 - this.value,
  259. name: "",
  260. label: {
  261. normal: {
  262. show: false
  263. }
  264. },
  265. itemStyle: {
  266. normal: {
  267. color: "#173164"
  268. }
  269. }
  270. }
  271. ]
  272. },
  273. {
  274. name: "",
  275. type: "gauge",
  276. radius: "58%",
  277. center: ['50%', '50%'],
  278. startAngle: 0,
  279. endAngle: 359.9,
  280. splitNumber: 8,
  281. hoverAnimation: true,
  282. axisTick: {
  283. show: false
  284. },
  285. splitLine: {
  286. length: 60,
  287. lineStyle: {
  288. width: 5,
  289. color: "#061740"
  290. }
  291. },
  292. axisLabel: {
  293. show: false
  294. },
  295. pointer: {
  296. show: false
  297. },
  298. axisLine: {
  299. lineStyle: {
  300. opacity: 0
  301. }
  302. },
  303. detail: {
  304. show: false
  305. },
  306. data: [{
  307. value: 0,
  308. name: ""
  309. }]
  310. },
  311. ]
  312. };
  313. return option;
  314. } */
  315. },
  316. }
  317. </script>
  318. <style scoped>
  319. .Chart {
  320. height: 130rem;
  321. width: 130rem;
  322. background:url("@/assets/images/tongda.png") no-repeat;
  323. background-size: 100% 100%;
  324. display: inline-block;
  325. margin-top: 40rem;
  326. margin-right: 400rem;
  327. position: absolute;
  328. }
  329. .fonts{
  330. font-size: 24rem;
  331. text-align: center;
  332. color: rgb(200, 250, 255);
  333. }
  334. .bottomFonts{
  335. margin-top: 90rem;
  336. font-size: 18rem;
  337. color: rgb(200, 250, 255);
  338. }
  339. .text {
  340. margin-top: 10rem;
  341. height: 170rem;
  342. width: 165rem;
  343. margin-left: 150rem;
  344. display: inline-block;
  345. position: relative;
  346. }
  347. .left {
  348. width: 50%;
  349. float: left;
  350. }
  351. .leftTop {
  352. margin-top: 30rem;
  353. color: rgb(200, 250, 255);
  354. font-size: 24rem;
  355. font-weight: bold;
  356. }
  357. .leftMid {
  358. color: rgb(200, 250, 255);
  359. font-size: 16rem;
  360. }
  361. .right {
  362. width: 50%;
  363. float: right;
  364. }
  365. .rightTop {
  366. margin-top: 30rem;
  367. color: rgb(200, 250, 255);
  368. font-size: 24rem;
  369. font-weight: bold;
  370. }
  371. .rightMid {
  372. color: rgb(200, 250, 255);
  373. font-size: 16rem;
  374. }
  375. </style>