<template>
  <div class="left-chart-3">
    <dv-capsule-chart class="lc3-chart" :config="config" />
  </div>
</template>

<script>
export default {
  name: "LeftChart3",
  props: {
    dataList: {
      type: Array,
      default: [],
    },
  },
  data() {
    return {
      config: {
        data: [],
        colors: ["#00baff", "#3de7c9", "#fff", "#ffc530", "#469f4b"],
        unit: "人",
        showValue: true
      },
    };
  },
  created() {
    this.getData();
  },
  methods: {
    getData() {
      this.config.data = this.dataList.map((item) => {
        return {
          name: item.age,
          value: item.count,
        };
      });
    },
  },
};
</script>

<style lang="scss">
.left-chart-3 {
  width: 100%;
  height: 70%;
  display: flex;
  flex-direction: column;

  .lc3-header {
    height: 20px;
    line-height: 20px;
    font-size: 16px;
    text-indent: 20px;
    margin-top: 10px;
  }

  .lc3-details {
    height: 40px;
    font-size: 16px;
    display: flex;
    align-items: center;
    text-indent: 20px;

    span {
      color: #096dd9;
      font-weight: bold;
      font-size: 35px;
      margin-left: 20px;
    }
  }

  .lc3-chart {
    flex: 1;
    padding: 0 10px;
  }
}
</style>
