Commit 974ee1162baf9d1ec5ec46c263e495edc840ae54
1 parent
9092f766
道闸
Showing
2 changed files
with
9 additions
and
16 deletions
src/components/allPieChart.vue
| @@ -4,8 +4,6 @@ | @@ -4,8 +4,6 @@ | ||
| 4 | 4 | ||
| 5 | <script> | 5 | <script> |
| 6 | import echarts from 'echarts' | 6 | import echarts from 'echarts' |
| 7 | - | ||
| 8 | -require('echarts/theme/macarons') // echarts theme | ||
| 9 | import {debounce} from '../utils/debounce' | 7 | import {debounce} from '../utils/debounce' |
| 10 | 8 | ||
| 11 | export default { | 9 | export default { |
| @@ -21,7 +19,7 @@ export default { | @@ -21,7 +19,7 @@ export default { | ||
| 21 | }, | 19 | }, |
| 22 | height: { | 20 | height: { |
| 23 | type: String, | 21 | type: String, |
| 24 | - default: '205px' | 22 | + default: '100%' |
| 25 | }, | 23 | }, |
| 26 | autoResize: { | 24 | autoResize: { |
| 27 | type: Boolean, | 25 | type: Boolean, |
| @@ -35,7 +33,6 @@ export default { | @@ -35,7 +33,6 @@ export default { | ||
| 35 | data() { | 33 | data() { |
| 36 | return { | 34 | return { |
| 37 | chart: null, | 35 | chart: null, |
| 38 | - sidebarElm: null | ||
| 39 | } | 36 | } |
| 40 | }, | 37 | }, |
| 41 | watch: { | 38 | watch: { |
| @@ -61,7 +58,6 @@ export default { | @@ -61,7 +58,6 @@ export default { | ||
| 61 | if (this.autoResize) { | 58 | if (this.autoResize) { |
| 62 | window.removeEventListener('resize', this.__resizeHandler) | 59 | window.removeEventListener('resize', this.__resizeHandler) |
| 63 | } | 60 | } |
| 64 | - | ||
| 65 | this.chart.dispose() | 61 | this.chart.dispose() |
| 66 | this.chart = null | 62 | this.chart = null |
| 67 | }, | 63 | }, |
| @@ -109,8 +105,9 @@ export default { | @@ -109,8 +105,9 @@ export default { | ||
| 109 | { | 105 | { |
| 110 | name: '半径模式', | 106 | name: '半径模式', |
| 111 | type: 'pie', | 107 | type: 'pie', |
| 112 | - radius: ['20%', '100%'], | 108 | + radius: ['20%', '90%'], |
| 113 | center: ['50%', '50%'], | 109 | center: ['50%', '50%'], |
| 110 | + hoverAnimation:false, | ||
| 114 | roseType: 'radius', | 111 | roseType: 'radius', |
| 115 | label: { | 112 | label: { |
| 116 | show: false | 113 | show: false |
| @@ -156,17 +153,14 @@ export default { | @@ -156,17 +153,14 @@ export default { | ||
| 156 | 153 | ||
| 157 | ], | 154 | ], |
| 158 | animationType: 'scale', | 155 | animationType: 'scale', |
| 159 | - animationEasing: 'elasticOut', | ||
| 160 | - animationDelay: function(idx) { | ||
| 161 | - return Math.random() * 200; | ||
| 162 | - } | 156 | + animationEasing: 'elasticOut' |
| 163 | } | 157 | } |
| 164 | 158 | ||
| 165 | ] | 159 | ] |
| 166 | }) | 160 | }) |
| 167 | }, | 161 | }, |
| 168 | initChart() { | 162 | initChart() { |
| 169 | - this.chart = echarts.init(this.$el, 'macarons') | 163 | + this.chart = echarts.init(this.$el) |
| 170 | this.setOptions(this.chartData) | 164 | this.setOptions(this.chartData) |
| 171 | } | 165 | } |
| 172 | } | 166 | } |
src/components/barChart.vue
| @@ -32,8 +32,7 @@ export default { | @@ -32,8 +32,7 @@ export default { | ||
| 32 | }, | 32 | }, |
| 33 | data() { | 33 | data() { |
| 34 | return { | 34 | return { |
| 35 | - chart: null, | ||
| 36 | - sidebarElm: null | 35 | + chart: null |
| 37 | } | 36 | } |
| 38 | }, | 37 | }, |
| 39 | watch: { | 38 | watch: { |
| @@ -116,9 +115,9 @@ export default { | @@ -116,9 +115,9 @@ export default { | ||
| 116 | top: 10, | 115 | top: 10, |
| 117 | containLabel: true | 116 | containLabel: true |
| 118 | }, | 117 | }, |
| 119 | - // tooltip: { | ||
| 120 | - // | ||
| 121 | - // }, | 118 | + tooltip: { |
| 119 | + | ||
| 120 | + }, | ||
| 122 | yAxis: { | 121 | yAxis: { |
| 123 | axisLabel : { | 122 | axisLabel : { |
| 124 | formatter: '{value}', | 123 | formatter: '{value}', |