Newer
Older
smartwell_front / src / views / dashboard / components / DeviceCountByOnline.vue
StephanieGitHub on 24 Sep 2019 766 bytes ADD:新增Dashboard页面
<template>
  <ve-pie :data="chartData" :extend="extend" :title="title"/>
</template>

<script>
export default {
  data() {
    this.extend = {
      series: {
        label: { show: true, position: 'outside', formatter: '{b}:{c}' }
      }
    }
    this.chartSettings = {
      labelMap: {
        'onlineStatus': '在线状态',
        'deviceCount': '设备数量'
      },
      dimension: 'onlineStatus',
      metrics: 'deviceCount'
    }
    this.title = {
      text: '设备在线情况统计'
    }
    return {
      chartData: {
        columns: ['onlineStatus', 'deviceCount'],
        rows: [
          { 'onlineStatus': '在线', 'deviceCount': 2532 },
          { 'onlineStatus': '离线', 'deviceCount': 0 }
        ]
      }
    }
  }
}
</script>