Category.vue
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<template>
<div class="category-box box">
<div class="title-icon">
<span class="title-bg">品类业务</span>
</div>
<div class="category-container flex">
<pie-chart ref="pieChartCategory" :id="chart.id" :list="categoryData" :formatter="chart.formatter" :colors="chart.colors"></pie-chart>
<OperationaLegend class="category-legend" :list="categoryData" :width="'4.17vw'" :height="'2.44vh'" :colors="chart.colors"></OperationaLegend>
</div>
</div>
</template>
<script>
import OperationaLegend from './OperationaLegend.vue'
export default {
name: 'Category',
components: {
OperationaLegend
},
data() {
return {
chart: {
id: 'category',
colors: ['#EB6001', '#34AFFF', '#16E193', '#BF98FF'],
formatter: 'rate'
}
}
},
props: {
categoryData: {
type: Array,
default: () => []
}
},
methods: {}
}
</script>
<style lang="scss" scoped>
.category-box {
overflow: hidden;
height: 13.9vh;
.title-icon {
font-weight: 500;
font-size: 14px;
color: #ffffff;
.title-bg {
background-image: linear-gradient(90deg, #003f57 0%, #111056 54%, #06142200 100%);
padding-left: 0.83vw;
}
}
.category-container {
height: 11.34vh;
// margin: 1.59vh 1.67vw 1.46vh 1.11vw;
.category-legend {
width: 4.2vw;
margin-right: 1.81vw;
}
}
}
</style>