Newer
Older
carbon-metering-front / src / views / count / components / carbonAnalyse.vue
liyaguang on 30 Mar 2023 864 bytes feat(*): 碳计算保存功能
<!-- 碳排放分析饼图 -->
<script lang="ts" setup>
import PieChart from '@/components/Echart/PieChart.vue'
const props = defineProps({
  data: {
    type: Array as any,
    defaule: () => { return [] },
  },
})
// 饼图数据
const data = ref([])
setTimeout(() => {
  console.log(props.data, '碳排数据')
  data.value = props.data
})
const picLegend = ref({
  show: false,
  orient: 'horizontal',
  // bottom: '5%',
  // left: 'center',
  icon: 'circle',
  itemWidth: 12,
  itemHeight: 12,
  itemStyle: {
    fontSize: 18,
  },
})
const bodyWidth = document.body.clientWidth
console.log(bodyWidth, 'bodyHeightbodyHeightbodyHeight')
// :width="`${blockWidth - 225}px`"
</script>

<template>
  <div style="width: 30%;">
    <div>碳排分析</div>
    <pie-chart
      :data="data"
      :width="`${400}px`"
      height="400px"
    />
  </div>
</template>