ViewChart.vue 2.03 KB
<!--
 * @Author: 前端 qianduan01@didihu.com.cn
 * @Date: 2022-10-26 10:22:41
 * @LastEditors: huyue
 * @LastEditTime: 2024-01-26 22:31:28
 * @FilePath: \dj-data-view\src\components\ViewChart.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="view-chart flex">
    <div class="line-chart">
      <LineChart domId="sumChart" boxHeight="17.54vh" :privateList="privateList"></LineChart>
    </div>
    <div class="pie-chart">
      <Age></Age>
      <Price></Price>
      <BuyCar></BuyCar>
      <Mileage></Mileage>
    </div>
  </div>
</template>

<script type="text/ecmascript-6">
import Age from './Age.vue'
import Price from './Price.vue'
import BuyCar from './BuyCar.vue'
import Mileage from './Mileage.vue'
import LineChart from './LineChart.vue'
import { userMixin } from '../../../mixins/index'
export default {
  name: 'ViewChart',
  mixins: [userMixin],
  components: {
    Age,
    Price,
    BuyCar,
    Mileage,
    LineChart
  },
  data() {
    return {
      privateList: []
    }
  },
  created() {
    this.getDistribution()
  },
  mounted() {
    this.$bus.$on('drawPrivateChart', data => {
      this.privateList = data
    })
  },
  methods: {}
}
</script>

<style scoped lang="scss">
.view-chart {
  height: 18.5vh;
  margin: 0.98vh 0;
  .line-chart {
    width: 25.14vw;
    height: 100%;
    // background: #071735;
    margin-right: 0.56vw;
  }
  .pie-chart {
    width: 26.52vw;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    /deep/ {
      .user-box {
        background-color: rgba(11, 44, 142, 0.28);
        width: 13.12vw;
      }
      .user-box:nth-child(1),
      .user-box:nth-child(3) {
        margin-right: 0.21vw;
      }
      .user-box:nth-child(1),
      .user-box:nth-child(2) {
        margin-bottom: 0.46vh;
      }
    }
  }
}
</style>