|
@@ -43,7 +43,8 @@ const props = defineProps({
|
|
|
const labelFormatter = (params: any) => {
|
|
|
// 显示人数 加 百分比
|
|
|
if (params.value > 0) {
|
|
|
- return props.data?.[params.dataIndex] + "人 (" + params.value + "%)";
|
|
|
+ //return props.data?.[params.dataIndex] + "人 (" + params.value + "%)";
|
|
|
+ return `{a|${props.data?.[params.dataIndex]}人 (${params.value}%)}`;
|
|
|
} else {
|
|
|
return "";
|
|
|
}
|
|
@@ -104,8 +105,13 @@ const options = {
|
|
|
type: "bar",
|
|
|
label: {
|
|
|
show: true,
|
|
|
- position: "right",
|
|
|
+ position: "insideLeft",
|
|
|
formatter: labelFormatter,
|
|
|
+ rich: {
|
|
|
+ a: {
|
|
|
+ padding: [0, 0, 0, 120]
|
|
|
+ },
|
|
|
+ },
|
|
|
},
|
|
|
showBackground: true,
|
|
|
backgroundStyle: {
|