ActivityRate.vue 1.37 KB
<template>
  <div class="rate-box">
    <BoxTitle :title="'各活动类型占比'" :fontSize="16"></BoxTitle>
    <pie-chart :id="chart.id" :keys="chart.keys" :list="activityListData" :formatter="'total'" :formatterName="'累计营销活动'" :formtUnit="'场'" :height="chart.height" :colors="chart.colors"></pie-chart>
    <Legend class="legend" :list="activityListData" :legentList="legentList" :colors="chart.colors"></Legend>
  </div>
</template>

<script>
import { activityListData } from "../const/index"
export default {
  name: 'ActivityRate',

  data() {
    return {
      chart: {
        id: 'shadowPie',
        keys: ['isused', 'num'],
        height: '17.7vh',
        colors: ['#6578FF', '#16E193', '#FFE73C', '#EB6001']
      },
      activityListData,
      legentList: [
        {
          name: 'isused',
          width: '4vw'
        },
        {
          name: 'rate',
          type: 'decimal',
          width: '2.5vw'
        },
        {
          name: 'num',
          width: '2.25vw',
          unitIcon: '场'
        }
      ]
    }
  },

  mounted() {},

  methods: {}
}
</script>

<style lang="scss" scoped>
.rate-box {
  box-sizing: border-box;
  width: 15vw;
  height: 34.23vh;
  background-image: url(../../../assets/images/rate-bg.png);
      background-size: 100% 100%;
      padding: 3.61vh 1.59vw 2.69vh 1.04vw;
}
.legend {
  margin-top: 2vh;
}
</style>