Newer
Older
smartKitchenFront / src / views / dashboard / components / layoutChartVerticalBar.vue
<template>
  <div class="chart-container">
    <div class="chart-header">
      <!--标题  -->
      <span class="title">区域设备排行榜</span>
    </div>
    <div class="chart-content" :style="{'height':height,'width':width}">
      <!-- echarts内容 -->
      <verticalBarChart :seriesData="seriesData" :yAxisData="yAxisData"/>
    </div>
  </div>
</template>

<script>
import verticalBarChart from '../../../components/echart/barChart/verticalBarChart.vue';
export default {
  name: "layoutChartSelect",
  components: {
    verticalBarChart,
  },
  props: {
    name: {
      type: String,
      default: "",
    },
    width:{
      type: String,
      default: "500px"
    },
    height:{
      type: String,
      default: "250px"
    }
  },
  data() {
    return {
      seriesData: [],
      yAxisData:[]
    };
  },
  mounted() {
    setTimeout(() => {
      this.seriesData = [
        {
          data: [120, 200, 150, 80, 70, 110, 130],
        },
      ];
      this.yAxisData = [
        '北京','上海','天津','河北','山东','四川','深圳'
      ]
    });
  },
};
</script>

<style lang="scss" scoped>
.chart-container {
  .chart-header {
    width: 600px;
    align-items: center;
    display: flex;
    justify-content: space-between;
  }
  .chart-content {
    // width: 600px;
    // height: 400px;
  }
}
</style>