Commit 530d57fd by 前端

commit

1 parent ac4bd30c
...@@ -108,7 +108,8 @@ img { ...@@ -108,7 +108,8 @@ img {
} }
.container { .container {
margin: 0 8px; height:8.54vh;
margin: 8px 6px 8px 8px;
} }
.empty { .empty {
......
<template>
<div class="legend">
<div class="legend-item flex" v-for="item in 5">
<span></span>
湘
</div>
</div>
</template>
<script>
export default {
name: 'Legend',
data() {
return {}
},
mounted() {},
methods: {}
}
</script>
<style lang="scss" scoped>
.legend {
display: flex;
align-items: center;
flex-wrap: wrap;
width: 7.7vw;
height: 8.54vh;
margin-left: 0.42vw;
.legend-item {
width: 3.68vw;
height: 2.44vh;
background: #0d133b;
align-items: center;
font-size: 9px;
color: #fff;
margin: 0 2px 2px 0;
box-sizing: border-box;
line-height: 2.44vh;
margin: 2px 2px 0 0;
span {
width: 5px;
height: 5px;
background: #bf98ff;
border-radius: 50%;
margin: 4px;
}
}
}
</style>
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<div class="center-content" :style="{ fontSize: size }"> <div class="center-content" :style="{ fontSize: size }">
<div :class="[id, 'center-content-num', 'center-content-num-color']"></div> <div :class="[id, 'center-content-num', 'center-content-num-color']"></div>
</div> </div>
<div class="content-desc"> <!-- <div class="content-desc">
<div class="content-desc-icon" :style="{ background: descColor }"></div> <div class="content-desc-icon" :style="{ background: descColor }"></div>
{{ numDesc }} {{ numDesc }}
</div> </div> -->
</div> </div>
</template> </template>
...@@ -27,7 +27,7 @@ export default { ...@@ -27,7 +27,7 @@ export default {
}, },
height: { height: {
type: String, type: String,
default: '12.7vh' default: '8.54vh'
}, },
list: { list: {
type: Array, type: Array,
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
}, },
radius: { radius: {
type: Array, type: Array,
default: () => ['50%', '70%'] default: () => ['60%', '89%']
}, },
colors: { colors: {
type: Array, type: Array,
......
...@@ -2,7 +2,13 @@ import { changeMixin } from './index' ...@@ -2,7 +2,13 @@ import { changeMixin } from './index'
export default { export default {
data() { data() {
return { return {
clientData: [], clientData: [
{ value: 1048, name: 'Search Engine' },
{ value: 735, name: 'Direct' },
{ value: 580, name: 'Email' },
{ value: 484, name: 'Union Ads' },
{ value: 300, name: 'Video Ads' }
],
brandList: [], brandList: [],
distributionRank: '', distributionRank: '',
isBrand: false, isBrand: false,
...@@ -37,7 +43,7 @@ export default { ...@@ -37,7 +43,7 @@ export default {
this.clientData.push({ this.clientData.push({
name: item, name: item,
// value: distribution[item] // value: distribution[item]
value: (distribution[item] / total * 100).toFixed(1) value: ((distribution[item] / total) * 100).toFixed(1)
}) })
}) })
console.log(this.clientData) console.log(this.clientData)
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<span>区域分布</span> <span>区域分布</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart>
<Legend></Legend>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,7 +19,9 @@ export default { ...@@ -18,7 +19,9 @@ export default {
mixins: [clientMixin], mixins: [clientMixin],
data() { data() {
return { return {
chart: {
id: 'area',
}
} }
} }
} }
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<span>品牌分布</span> <span>品牌分布</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart>
<Legend></Legend>
</div> </div>
</div> </div>
</template> </template>
...@@ -19,7 +20,7 @@ export default { ...@@ -19,7 +20,7 @@ export default {
return { return {
type: 'gender', type: 'gender',
chart: { chart: {
id: 'sex-pie', id: 'brand',
colors: ['#EB6001', '#BF98FF', '#FF6E76'] colors: ['#EB6001', '#BF98FF', '#FF6E76']
} }
} }
......
<!--
* @Description: 客户购车年限
* @Author: huyue
* @Date: 2022-06-23 15:06:32
* @LastEditors: huyue
* @LastEditTime: 2022-06-23 17:03:19
-->
<template> <template>
<div> <div>
<div class="title title-icon"> <div class="title title-icon">
<span class="icon"></span> <span class="icon"></span>
<span>门店类型</span> <span>门店类型</span>
</div> </div>
<div class="container flex"> <div class="container flex">
<pie-chart :id="chart.id" :list="clientData"></pie-chart>
<Legend></Legend>
</div> </div>
</div> </div>
</template> </template>
...@@ -26,7 +20,7 @@ export default { ...@@ -26,7 +20,7 @@ export default {
return { return {
type: 'buycarRange', type: 'buycarRange',
chart: { chart: {
id: 'car-pie' id: 'store'
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!