123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399 |
- <template>
- <div class="Chart">
- <div class="fonts">
- 100%
- </div>
- <div class="bottomFonts">
- 道路通达率
- </div>
-
- </div>
- <div class="text">
- <div class="left">
- <div class="leftTop">11.2km</div>
- <div class="leftMid">田路总长度</div>
- <div class="leftTop">0.8km</div>
- <div class="leftMid">机耕路长度</div>
- </div>
- <div class="right">
- <div class="rightTop">1.8km</div>
- <div class="rightMid">主路长度</div>
- <div class="rightTop">0.4km</div>
- <div class="rightMid">生产路长度</div>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- option: {},
- value: 50,
- angle: 30
- }
- },
- created() {
- },
- mounted() {
-
- },
- methods: {
- /* getCirlPoint(x0, y0, r, angle) {
- let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
- let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
- return {
- x: x1,
- y: y1
- }
- },
- typeCharts() {
- this.option = this.getOption();
- // var chartDom = document.getElementById('echarts');
- // var myChart = echarts.init(chartDom);
- // myChart.setOption(option, true);
- },
- getOption(data) {
- let angle = 30;
- let option = {
- title: {
- text: '{a|' + '企业' + '}',
- x: 'center',
- y: 'center',
- textStyle: {
- rich: {
- a: {
- fontSize: 20,
- color: '#29EEF3'
- },
- c: {
- fontSize: 16,
- color: '#ffffff',
- // padding: [5,0]
- }
- }
- }
- },
- series: [{
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
- startAngle: (0 + angle) * Math.PI / 180,
- endAngle: (90 + angle) * Math.PI / 180
- },
- style: {
- stroke: "#0CD3DB",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
- startAngle: (180 + angle) * Math.PI / 180,
- endAngle: (270 + angle) * Math.PI / 180
- },
- style: {
- stroke: "#0CD3DB",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75,
- startAngle: (270 + -angle) * Math.PI / 180,
- endAngle: (40 + -angle) * Math.PI / 180
- },
- style: {
- stroke: "#0CD3DB",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- return {
- type: 'arc',
- shape: {
- cx: api.getWidth() / 2,
- cy: api.getHeight() / 2,
- r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75,
- startAngle: (90 + -angle) * Math.PI / 180,
- endAngle: (220 + -angle) * Math.PI / 180
- },
- style: {
- stroke: "#0CD3DB",
- fill: "transparent",
- lineWidth: 1.5
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5",
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75;
- let point = {
- x:30,
- y:40
- }
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#0CD3DB", //粉
- fill: "#0CD3DB"
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: "ring5", //绿点
- type: 'custom',
- coordinateSystem: "none",
- renderItem: function(params, api) {
- let x0 = api.getWidth() / 2;
- let y0 = api.getHeight() / 2;
- let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.75;
- let point = {
- x:30,
- y:40
- }
- return {
- type: 'circle',
- shape: {
- cx: point.x,
- cy: point.y,
- r: 4
- },
- style: {
- stroke: "#0CD3DB", //绿
- fill: "#0CD3DB"
- },
- silent: true
- };
- },
- data: [0]
- },
- {
- name: '覆盖率',
- type: 'pie',
- radius: ['58%', '45%'],
- silent: true,
- clockwise: true,
- startAngle: 90,
- z: 0,
- zlevel: 0,
- label: {
- normal: {
- position: "center",
- }
- },
- data: [{
- value: 79,
- name: "",
- itemStyle: {
- normal: {
- color: { // 完成的圆环的颜色
- colorStops: [{
- offset: 0,
- color: '#4FADFD' // 0% 处的颜色
- }, {
- offset: 1,
- color: '#28E8FA' // 100% 处的颜色
- }]
- },
- }
- }
- },
- {
- value: 100 - this.value,
- name: "",
- label: {
- normal: {
- show: false
- }
- },
- itemStyle: {
- normal: {
- color: "#173164"
- }
- }
- }
- ]
- },
- {
- name: "",
- type: "gauge",
- radius: "58%",
- center: ['50%', '50%'],
- startAngle: 0,
- endAngle: 359.9,
- splitNumber: 8,
- hoverAnimation: true,
- axisTick: {
- show: false
- },
- splitLine: {
- length: 60,
- lineStyle: {
- width: 5,
- color: "#061740"
- }
- },
- axisLabel: {
- show: false
- },
- pointer: {
- show: false
- },
- axisLine: {
- lineStyle: {
- opacity: 0
- }
- },
- detail: {
- show: false
- },
- data: [{
- value: 0,
- name: ""
- }]
- },
- ]
- };
- return option;
- } */
- },
- }
- </script>
- <style scoped>
- .Chart {
- height: 130rem;
- width: 130rem;
- background:url("@/assets/images/tongda.png") no-repeat;
- background-size: 100% 100%;
- display: inline-block;
- margin-top: 40rem;
- margin-right: 400rem;
- position: absolute;
- }
- .fonts{
- font-size: 24rem;
- text-align: center;
- color: rgb(200, 250, 255);
-
- }
- .bottomFonts{
- margin-top: 90rem;
- font-size: 18rem;
- color: rgb(200, 250, 255);
- }
- .text {
- margin-top: 10rem;
- height: 170rem;
- width: 165rem;
- margin-left: 150rem;
- display: inline-block;
- position: relative;
- }
- .left {
- width: 50%;
- float: left;
-
- }
- .leftTop {
- margin-top: 30rem;
- color: rgb(200, 250, 255);
- font-size: 24rem;
- font-weight: bold;
- }
- .leftMid {
- color: rgb(200, 250, 255);
- font-size: 16rem;
- }
- .right {
- width: 50%;
- float: right;
- }
- .rightTop {
- margin-top: 30rem;
- color: rgb(200, 250, 255);
- font-size: 24rem;
- font-weight: bold;
- }
-
- .rightMid {
- color: rgb(200, 250, 255);
- font-size: 16rem;
- }
-
- </style>
|