소스 검색

build: 评分占比柱状图调整

chaooo 2 년 전
부모
커밋
79bbfc1397
1개의 변경된 파일8개의 추가작업 그리고 2개의 파일을 삭제
  1. 8 2
      src/components/Charts/PercentBarChart.vue

+ 8 - 2
src/components/Charts/PercentBarChart.vue

@@ -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: {