| | |
| | | |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | //引入提示框 |
| | | import "echarts/lib/component/tooltip"; |
| | | //引入chart字体自适应 |
| | | import { |
| | | chartFontsize |
| | | } from '@/assets/js/chartFontsize' |
| | | const pieImg = require('../../assets/images/rectifier-img.png'); |
| | | export default { |
| | | name: "imgPieChart", |
| | |
| | | this.$options.chart.setOption(opt); |
| | | }, |
| | | setData(sendData) { |
| | | this.$options.chartData = sendData |
| | | this.$options.chartData = sendData; |
| | | let imgWidth = this.$refs.chart.clientWidth * 0.14; |
| | | let imgheight = imgWidth / 0.82; |
| | | let centerx = this.$refs.chart.clientWidth / 2; |
| | |
| | | rich: { |
| | | yellow: { |
| | | color: "#f67f21", |
| | | fontSize: 16, |
| | | fontSize: chartFontsize(16), |
| | | fontWeight: '600', |
| | | padding: [4, 0, 0, 0], |
| | | padding: [chartFontsize(4), 0, 0, 0], |
| | | align: 'center' |
| | | }, |
| | | white: { |
| | | color: "#ffffff", |
| | | align: 'center', |
| | | fontSize: 12, |
| | | padding: 4 |
| | | fontSize: chartFontsize(12), |
| | | padding: chartFontsize(4) |
| | | }, |
| | | hr: { |
| | | borderColor: '#007ed3', |
| | |
| | | }, |
| | | resize() { |
| | | this.$options.chart.resize(); |
| | | this.setData(this.$options.chartData) |
| | | this.setData(this.$options.chartData); |
| | | } |
| | | }, |
| | | mounted() { |