3D 饼图
TIP
使用该组件需要提前安装threeJs、当前所用版本0.164.1
圆环饼图
66.4%
TM
21.7%
DOUYIN
7.6%
JD
2.4%
VIP
1.9%
Others
代码示例
vue
<template>
<BqPie/>
</template>
饼图
66.4%
TM
21.7%
DOUYIN
7.6%
JD
2.4%
VIP
1.9%
Others
代码示例
vue
<template>
<BqPie :innerRadius="0"/>
</template>
隐藏中间提示
代码示例
vue
<template>
<BqPie :centerTooltip="false" />
</template>
增加背景图
66.4%
TM
21.7%
DOUYIN
7.6%
JD
2.4%
VIP
1.9%
Others
代码示例
vue
<template>
<div class="slot-pie">
<BqPie>
<template v-slot:footer>
<div class="footer">
<img :src="imgSrc" />
</div>
</template>
</BqPie>
</div>
</template>
<script setup lang="ts">
defineOptions({ name: "BqSlotPie" });
const imgSrc = "https://tqa.oss-cn-shanghai.aliyuncs.com/val/024af179-9e6d-4ce1-84c6-86a2ddb42ca5.png";
</script>
<style lang="scss" scoped>
.slot-pie {
background-color: black;
:deep(.three-pie-main) {
z-index: 2;
}
.footer {
position: absolute;
top: 17%;
left: 50%;
z-index: 1;
width: 50%;
transform: translateX(-50%);
}
}
</style>
API
成员 | 说明 | 类型 |
---|---|---|
data | 需要展示的数据 | Array<data: {label: string;value: number;}> |
colorList | 饼图颜色 | string[] |
innerRadius | 内环半径 | number |
outerRadius | 外环半径 | number |
depth | 饼图深度 | number |
centerTooltip | 中间提示 | boolean |
插槽
插槽名 | 说明 |
---|---|
footer | 自定义默认内容 |