| | |
| | | import * as echarts from "echarts"; |
| | | |
| | | const getRadiusBarOption = ()=>{ |
| | | const getRadiusBarOption = (data)=>{ |
| | | const defaultOption = { |
| | | minRatio: 0, |
| | | maxRatio: 1.2, |
| | | grid: { |
| | | top: '15%', |
| | | right: '3%', |
| | | left: '8%', |
| | | bottom: '12%' |
| | | }, |
| | | }; |
| | | const option = {...defaultOption, ...data}; |
| | | return { |
| | | tooltip: { |
| | | trigger: 'axis', |
| | |
| | | type: 'shadow' |
| | | } |
| | | }, |
| | | grid: { |
| | | top: '15%', |
| | | right: '3%', |
| | | left: '10%', |
| | | bottom: '12%' |
| | | }, |
| | | grid: option.grid, |
| | | xAxis: [{ |
| | | type: 'category', |
| | | data: ['9.21', '9.22', '9.23', '9.24', '9.25', '9.26', '9.27'], |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: 'rgba(255,255,255,0.12)' |
| | |
| | | }, |
| | | }], |
| | | yAxis: [{ |
| | | min(data) { |
| | | const min =data.min; |
| | | if(isNaN(min)) { |
| | | return 0; |
| | | }else { |
| | | return min * option.minRatio; |
| | | } |
| | | }, |
| | | max(data) { |
| | | const max = data.max; |
| | | if(isNaN(max)) { |
| | | return 1; |
| | | }else { |
| | | return max * option.maxRatio; |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | formatter: '{value}', |
| | | color: '#e2e9ff', |
| | | }, |
| | | axisLine: { |
| | | show: false |
| | | show: true, |
| | | lineStyle: { |
| | | color: 'rgba(255,255,255,0.12)' |
| | | } |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | |
| | | }], |
| | | series: [{ |
| | | type: 'bar', |
| | | data: [300, 450, 770, 203, 255, 188, 156], |
| | | // data: [["2021",100]], |
| | | data: [], |
| | | barWidth: '20px', |
| | | itemStyle: { |
| | | normal: { |