| | |
| | | return fontSize; |
| | | } |
| | | |
| | | // 折线图 |
| | | function factorLineOption(_xAxis, _series, legends) { |
| | | var fontSize = fGetChartFontSize(); |
| | | return { |
| | |
| | | }; |
| | | } |
| | | |
| | | export { factorLineOption }; |
| | | // 仪表盘 |
| | | function gaugeOption(name, value) { |
| | | var fontSize = fGetChartFontSize(); |
| | | var option = { |
| | | title: { |
| | | text: name, |
| | | textStyle: { |
| | | color: 'white', |
| | | fontSize: fontSize |
| | | }, |
| | | left: 'center' |
| | | }, |
| | | textStyle: { |
| | | color: '#ffffff', |
| | | fontSize: 10 |
| | | }, |
| | | tooltip: { |
| | | formatter: '{a} <br/>{b} : {c}%' |
| | | }, |
| | | toolbox: { |
| | | // feature: { |
| | | // restore: {}, |
| | | // saveAsImage: {} |
| | | // } |
| | | }, |
| | | series: [ |
| | | { |
| | | name: name, |
| | | type: 'gauge', |
| | | detail: { |
| | | color: 'white', |
| | | formatter: '{value}', |
| | | textStyle: { |
| | | fontSize: fontSize |
| | | } |
| | | }, |
| | | splitLine: { |
| | | lineStyle: { |
| | | color: 'white' |
| | | } |
| | | }, |
| | | axisTick: { |
| | | lineStyle: { |
| | | color: 'white' |
| | | } |
| | | }, |
| | | axisLabel: { |
| | | color: 'white', |
| | | fontSize: 10 |
| | | }, |
| | | axisLine: { |
| | | lineStyle: { |
| | | color: [ |
| | | [0.2, '#2afd2a'], |
| | | [0.8, '#f1e74d'], |
| | | [1, '#c23531'] |
| | | ] |
| | | } |
| | | }, |
| | | itemStyle: { |
| | | color: 'white' |
| | | }, |
| | | data: [ |
| | | { |
| | | value: value, |
| | | name: '' |
| | | } |
| | | ], |
| | | min: 0, |
| | | max: 200 |
| | | } |
| | | ] |
| | | }; |
| | | return option; |
| | | } |
| | | |
| | | export { factorLineOption, gaugeOption }; |