Newer
Older
smartKitchenFront / src / views / dashboard / components / layoutChartDoughnu.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内容 -->
      <doughnutChart :seriesData="seriesData"/>
    </div>
  </div>
</template>

<script>
import doughnutChart from '../../../components/echart/pieChart/doughnutChart.vue';
export default {
  name: "layoutChartSelect",
  components: {
    doughnutChart,
  },
  props: {
    name: {
      type: String,
      default: "",
    },
    width:{
      type: String,
      default: "500px"
    },
    height:{
      type: String,
      default: "250px"
    }
  },
  data() {
    return {
      value: "12",
      options: [
        {
          value: "12",
          label: "近一年",
        },
        {
          value: "1",
          label: "近一月",
        },
      ],
      seriesData: [],
    };
  },
  mounted() {
    setTimeout(() => {
      this.seriesData = [
        { value: 1048, name: 'banana' },
        { value: 735, name: 'orange' },
        { value: 222, name: 'apple'}
      ]
    });
  },
};
</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>