|
@@ -21,6 +21,10 @@ const legendItems = ref([
|
|
|
color: '#c3c71b'
|
|
|
}
|
|
|
])
|
|
|
+function showValue(name) {
|
|
|
+ return props.dxjjList.find(item => item.name === name)?.value
|
|
|
+}
|
|
|
+
|
|
|
function initChart() {
|
|
|
chart = echarts.init(pieChart3d.value);
|
|
|
// 传入数据生成 option
|
|
@@ -380,7 +384,7 @@ function getPie3D(pieData, internalDiameterRatio) {
|
|
|
<ul class="legend">
|
|
|
<li v-for="(legend,idx) in legendItems" @click="$emit('click-item', legend.name)" :style="{
|
|
|
'--bg': legend.color
|
|
|
- }" :key="idx">{{ legend.name }}</li>
|
|
|
+ }" :key="idx">{{ legend.name }}({{ showValue(legend.name) }})</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -394,7 +398,7 @@ function getPie3D(pieData, internalDiameterRatio) {
|
|
|
.container .legend {
|
|
|
position: absolute;
|
|
|
right: 10px;
|
|
|
- top: 55px;
|
|
|
+ top: 130px;
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
gap: 10px;
|
|
@@ -402,7 +406,6 @@ function getPie3D(pieData, internalDiameterRatio) {
|
|
|
& > li {
|
|
|
list-style: none;
|
|
|
cursor: pointer;
|
|
|
- font-size: 14px;
|
|
|
}
|
|
|
& > li::before {
|
|
|
content: "";
|