operationNum.vue 7.12 KB
Newer Older
yaqizhang's avatar
yaqizhang committed
1
<template>
yaqizhang's avatar
yaqizhang committed
2
    <div class="display">
yaqizhang's avatar
yaqizhang committed
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186
        <div class="leftbar">
            <div class="leftnum">
                <img src="../../../../assets/mapinages/Group1120.png" alt="" style="width: 80px;">
                <span style="margin-left: 20px;margin-right: 20px;">充装数量分析</span>
                <img src="../../../../assets/mapinages/Group1121.png" alt="" style="width: 80px;">
            </div>
            <div id="echartsone" style="width:100%;height:300px;"></div>
        </div>
        <div class="centerbar">
            <div class="leftnum">
                <img src="../../../../assets/mapinages/Group1120.png" alt="" style="width: 80px;">
                <span style="margin-left: 20px;margin-right: 20px;">预警分析</span>
                <img src="../../../../assets/mapinages/Group1121.png" alt="" style="width: 80px;">
            </div>
            <div id="echartstwo" style="width:100%;height:300px;"></div>
        </div>
        <div class="rightbar">
            <div class="leftnum">
                <img src="../../../../assets/mapinages/Group1120.png" alt="" style="width: 80px;">
                <span style="margin-left: 20px;margin-right: 20px;">瓶装燃气用户汇总分析</span>
                <img src="../../../../assets/mapinages/Group1121.png" alt="" style="width: 80px;">
            </div>
            <div id="echartsthree" style="width:100%;height:300px;"></div>
        </div>
    </div>
    
</template>
  
  <script>
  import * as echarts from 'echarts';
  export default {
      name:"",
      data () {
          return {
              
          }
      },
      mounted () {
          this.drawLine()
      },
      methods: {
        drawLine() {
        // 基于准备好的dom,初始化echarts实例
            let myChart1 = this.$echarts.init(document.getElementById("echartsone"));
            let myChart2 = this.$echarts.init(document.getElementById("echartstwo"));
            let myChart3 = this.$echarts.init(document.getElementById("echartsthree"));
            // 绘制图表
            myChart1.setOption({
                color: ['#4CC4E0'],
                grid: {
                    left: '0',
                    right: '0',
                    bottom: '1%',
                    containLabel: true
                },
                tooltip: {},
                xAxis: {
                    type: 'category',
                    data: ['平山', '东回舍', '温塘', '南甸', '古月', '西柏坡', '小觉','下口','两河乡'],
                    axisLine: {
                     lineStyle: {
                         type:  'solid' ,
                         color:  '#99E2FF' , //左边线的颜色
                         width: '2' //坐标线的宽度
                     }
                    },
                    axisLabel: {
                        interval: 0,
                        textStyle: {
                            color:  '#000' , //坐标值得具体的颜色
    
                        }
                    }
                },
                yAxis: {
                    type: 'value'
                },
                series: [
                    {
                    data: [1200, 2000, 1500, 800, 700, 1100, 4300,1234,3456],
                    type: 'bar',
                    barWidth : 7,
                    }
                ]
            });
            myChart2.setOption({
                color: ['#4CC4E0','#EEC25B','#8E83DE'],
                grid: {
                    left: '0',
                    right: '0',
                    bottom: '1%',
                    containLabel: true
                },
                legend: {
                    orient:"horizontal",
                    icon: "circle",
                    x:'center',
                    y:' center',
                    width:'300',
                    padding:[25, 30,0, 0],
                    itemWidth:10,
                    textStyle:{
                        color:'#000',
                    },
                },
                tooltip: {},
                dataset: {
                    source: [
                    ['product', '入户安检', '超重', '超量'],
                    ['平山', 143.3, 185.8, 93.7],
                    ['东回舍', 83.1, 173.4, 55.1],
                    ['温塘', 86.4, 65.2, 82.5],
                    ['南甸', 43.3, 85.8, 393.7],
                    ['古月', 183.1, 273.4, 55.1],
                    ['西柏坡', 186.4, 265.2, 82.5],
                    ['小觉', 43.3, 185.8, 493.7],
                    ['下口', 483.1, 273.4, 55.1],
                    ['两河乡', 286.4, 265.2, 382.5],
                    ['孟家庄', 272.4, 453.9, 139.1]
                    ]
                },
                xAxis: { 
                    type: 'category',
                    axisLine: {
                        lineStyle: {
                            type:  'solid' ,
                            color:  '#99E2FF' , //左边线的颜色
                            width: '2' //坐标线的宽度
                        }
                    },
                    axisLabel: {
                        textStyle: {
                            color:  '#000' , //坐标值得具体的颜色
    
                        }
                    }
                },
                yAxis: {},
                series: [{ type: 'bar',barWidth : 7, }, { type: 'bar',barWidth : 7, }, { type: 'bar',barWidth : 7, }]
            });
            myChart3.setOption({
                color: ['#4CC4E0'],
                grid: {
                    left: '0',
                    right: '0',
                    bottom: '1%',
                    containLabel: true
                },
                tooltip: {},
                xAxis: {
                    type: 'category',
                    axisLabel:{
                        interval: 0,
                        textStyle: {
                            color:  '#000' , //坐标值得具体的颜色
                        }
                    } ,
                    data: ['平山', '东回舍', '温塘', '南甸', '古月', '西柏坡', '小觉','下口','两河乡'],
                    axisLine: {
                     lineStyle: {
                         type:  'solid' ,
                         color:  '#99E2FF' , //左边线的颜色
                         width: '2' //坐标线的宽度
                     }
                    },
                },
                yAxis: {
                    type: 'value',
                },
                series: [
                    {
                    data: [1240, 2040, 1540, 3380, 4370, 1140, 2130,1234,3456],
                    type: 'bar',
                    barWidth : 7,
                    }
                ]
            });
        }

      }
  }
</script>
  
<style scoped>
yaqizhang's avatar
yaqizhang committed
187 188 189 190
    .display{
        display: flex;
        
    }
yaqizhang's avatar
yaqizhang committed
191
.leftbar{
yaqizhang's avatar
yaqizhang committed
192
    width: 27.5%;
yaqizhang's avatar
yaqizhang committed
193
    height: 340px;
yaqizhang's avatar
yaqizhang committed
194
    /* float: left; */
yaqizhang's avatar
yaqizhang committed
195 196 197 198
}
.centerbar{
    width: 45%;
    height: 340px;
yaqizhang's avatar
yaqizhang committed
199
    /* float: left; */
yaqizhang's avatar
yaqizhang committed
200 201 202
    margin-left: 40px;
}
.rightbar{
yaqizhang's avatar
yaqizhang committed
203
    width: 27.5%;
yaqizhang's avatar
yaqizhang committed
204
    height: 340px;
yaqizhang's avatar
yaqizhang committed
205
    /* float: left; */
yaqizhang's avatar
yaqizhang committed
206 207 208 209 210 211 212 213 214 215
    margin-left: 40px;
}
.leftnum{
    width: 100%;
    height: 40px;
    text-align: center;
    line-height: 70px;
}
</style>