|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
<template>
|
|
|
<div class="TrendCon-container">
|
|
|
<div class="chart" id="chart_left3"></div>
|
|
@@ -6,40 +5,30 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-export default {
|
|
|
- name: "TrendCon",
|
|
|
- data() {
|
|
|
- return {
|
|
|
+ import screenfull from "screenfull";
|
|
|
|
|
|
- }
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.getEchartLeft3();
|
|
|
- },
|
|
|
- methods: {
|
|
|
- getEchartLeft3() {
|
|
|
- let myChart = echarts.init(document.getElementById('chart_left3'));
|
|
|
- let dataC1 =[2630, 16402,26343,38874,43352,55475,22263,19097,1872,140,1836,936,];
|
|
|
- let dataC2 =[5794, 21558,24702,16067,2358,5206,502,421,62,7,1,1,]
|
|
|
- let dataC3 =[2761, 17238,28060,44730,78630,75993,80813,80904,83824,84507,87457,90271,]
|
|
|
+ export default {
|
|
|
+ name: "TrendCon",
|
|
|
+ data() {
|
|
|
+ return {}
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getEchartLeft3();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getEchartLeft3() {
|
|
|
+ let myChart = echarts.init(document.getElementById('chart_left3'));
|
|
|
+ let dataC1 = [2630, 16402, 26343, 38874, 43352, 55475, 22263, 19097, 1872, 140, 1836, 936,];
|
|
|
+ let dataC2 = [5794, 21558, 24702, 16067, 2358, 5206, 502, 421, 62, 7, 1, 1,]
|
|
|
+ let dataC3 = [2761, 17238, 28060, 44730, 78630, 75993, 80813, 80904, 83824, 84507, 87457, 90271,]
|
|
|
|
|
|
- var xData = function() {
|
|
|
- var data = [];
|
|
|
+ var xData = function () {
|
|
|
+ var data = [];
|
|
|
for (var i = 1; i < 12; i++) {
|
|
|
data.push(i + "月");
|
|
|
}
|
|
|
return data;
|
|
|
}();
|
|
|
-
|
|
|
- // for(var i = 0;i<xData.length;i++){
|
|
|
- // dataC1.splice(i,1,{name:xData[i],value:dataC1[i]});
|
|
|
- // dataC2.splice(i,1,{name:xData[i],value:dataC2[i]});
|
|
|
- // dataC3.splice(i,1,{name:xData[i],value:dataC3[i]});
|
|
|
- // }
|
|
|
- // console.log(dataC1);
|
|
|
- // console.log(dataC2);
|
|
|
- // console.log(dataC3);
|
|
|
-
|
|
|
// var fontColor = '#30eee9';
|
|
|
let option = {
|
|
|
// backgroundColor: '#11183c',
|
|
@@ -51,7 +40,7 @@ export default {
|
|
|
containLabel: true
|
|
|
},
|
|
|
tooltip: {
|
|
|
- trigger: 'axis',
|
|
|
+ trigger: 'item',
|
|
|
axisPointer: {
|
|
|
type: 'shadow',
|
|
|
lineStyle: {
|
|
@@ -59,6 +48,27 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ toolbox: {
|
|
|
+ feature: {
|
|
|
+ mytool: {
|
|
|
+ show: true,
|
|
|
+ title: "全屏",
|
|
|
+ icon: 'path://M181 357.5V181.2h176.4c14.3 0 25.9-11.6 25.9-25.9v-31.1c0-14.3-11.6-25.9-25.9-25.9H118c-11 0-20 9-20 20v239.4c0 14.3 11.6 25.9 25.9 25.9H155c14.4-0.1 26-11.7 26-26.1zM668.6 181.2H845v176.4c0 14.3 11.6 25.9 25.9 25.9H902c14.3 0 25.9-11.6 25.9-25.9V118.2c0-11-9-20-20-20H668.6c-14.3 0-25.9 11.6-25.9 25.9v31.1c0 14.3 11.6 26 25.9 26zM357.4 845.2H181V668.8c0-14.3-11.6-25.9-25.9-25.9H124c-14.3 0-25.9 11.6-25.9 25.9v239.4c0 11 9 20 20 20h239.4c14.3 0 25.9-11.6 25.9-25.9v-31.1c-0.1-14.4-11.7-26-26-26zM845 668.8v176.4H668.6c-14.3 0-25.9 11.6-25.9 25.9v31.1c0 14.3 11.6 25.9 25.9 25.9H908c11 0 20-9 20-20V668.8c0-14.3-11.6-25.9-25.9-25.9H871c-14.4 0-26 11.6-26 25.9z',
|
|
|
+ onclick: function () {
|
|
|
+ const element = document.getElementById('chart_left3');
|
|
|
+ if (!screenfull.isEnabled) {//判断是否支持全屏
|
|
|
+ this.$message({
|
|
|
+ message: '您的浏览器暂时不支持全屏切换',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ screenfull.toggle(element)
|
|
|
+
|
|
|
+ },
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
legend: {
|
|
|
data: ['现有确诊', '现有疑似', '累计确诊'],
|
|
|
itemWidth: 20,
|