| | |
| | | //引入echart |
| | | import * as echarts from "echarts"; |
| | | let myChart; |
| | | let myRightChart; |
| | | export default { |
| | | components: { |
| | | ChartTitle, |
| | |
| | | // rotate:45, |
| | | margin: 10, |
| | | show: true, |
| | | fontSize:12, |
| | | fontSize: 12, |
| | | textStyle: { |
| | | color: function (params, index) { |
| | | let colorList = ["#dcb018", "#00FFFF"]; |
| | |
| | | }, |
| | | getChartRight(chartName, data) { |
| | | let chartDom = this.$refs[chartName]; |
| | | let myChart = echarts.init(chartDom); |
| | | // let myRightChart = echarts.init(chartDom); |
| | | if ( |
| | | myRightChart != null && |
| | | myRightChart != "" && |
| | | myRightChart != undefined |
| | | ) { |
| | | myRightChart.dispose(); //销毁 |
| | | } |
| | | myRightChart = echarts.init(chartDom); |
| | | let img = "/cockpitPage/dotted-circle.png"; |
| | | let option; |
| | | if (data) { |
| | |
| | | ], |
| | | }; |
| | | |
| | | option && myChart.setOption(option); |
| | | option && myRightChart.setOption(option); |
| | | } else { |
| | | option = {}; |
| | | myChart.setOption(option, true); |
| | | myRightChart.setOption(option, true); |
| | | } |
| | | }, |
| | | }, |