From cdd5b449130ea4d7223fde4f414a11a7d0c33d6d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 07 三月 2024 17:52:16 +0800
Subject: [PATCH] 2024-03-07

---
 src/menu/components/chart/antv-bar/index.jsx |   46 +++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 43 insertions(+), 3 deletions(-)

diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx
index 8074b88..0ad4db4 100644
--- a/src/menu/components/chart/antv-bar/index.jsx
+++ b/src/menu/components/chart/antv-bar/index.jsx
@@ -337,6 +337,9 @@
           if (plot.show === 'percent') {
             value = value + '%'
           }
+          if (plot.labelUnit) {
+            value = value + plot.labelUnit
+          }
           let _color = color
 
           if (plot.labelColor === 'custom' && colors.has(key)) {
@@ -720,6 +723,9 @@
             if (plot.show === 'percent') {
               value = value + '%'
             }
+            if (plot.labelUnit) {
+              value = value + plot.labelUnit
+            }
 
             if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
               lablecfg.style.fill = colors.get(key)
@@ -770,6 +776,9 @@
           _chart.label('value*key', (value, key) => {
             if (plot.show === 'percent') {
               value = value + '%'
+            }
+            if (plot.labelUnit) {
+              value = value + plot.labelUnit
             }
 
             if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
@@ -842,6 +851,9 @@
             if (item.show === 'percent') {
               value = value + '%'
             }
+            if (plot.labelUnit) {
+              value = value + plot.labelUnit
+            }
 
             if (plot.label === 'true' && plot.labelColor === 'custom') {
               lablecfg.style.fill = item.color
@@ -884,6 +896,9 @@
           _chart.label(item.name, (value) => {
             if (item.show === 'percent') {
               value = value + '%'
+            }
+            if (plot.labelUnit) {
+              value = value + plot.labelUnit
             }
             let _color = color
 
@@ -977,12 +992,31 @@
       if (plot.grid === 'hidden') {
         yc.grid = null
       }
-      if (plot.y_line === 'show') {
+      if (plot.tick === 'hidden') {
+        xc.tickLine = null
+      }
+      if (plot.x_line === 'hidden') {
+        xc.line = null
+      }
+      if (plot.y_line === 'hidden') {
+        yc.line = null
+      } else {
         yc.line = {style: { stroke: '#D1D2CE' }}
       }
+      if (plot.x_label === 'hidden') {
+        xc.label = null
+      }
+      if (plot.y_label === 'hidden') {
+        yc.label = null
+      }
+
       if (plot.lineColor) {
-        xc.tickLine = {style: { stroke: plot.lineColor }}
-        xc.line = { style: { stroke: plot.lineColor } }
+        if (xc.tickLine !== null) {
+          xc.tickLine = {style: { stroke: plot.lineColor }}
+        }
+        if (xc.line !== null) {
+          xc.line = { style: { stroke: plot.lineColor } }
+        }
         if (yc.grid !== null) {
           yc.grid = { line: { style: { stroke: plot.lineColor } }}
         }
@@ -1119,6 +1153,9 @@
             if (plot.show === 'percent') {
               value = value + '%'
             }
+            if (plot.labelUnit) {
+              value = value + plot.labelUnit
+            }
 
             if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
               lablecfg.style.fill = colors.get(key)
@@ -1180,6 +1217,9 @@
             if (plot.show === 'percent') {
               value = value + '%'
             }
+            if (plot.labelUnit) {
+              value = value + plot.labelUnit
+            }
 
             if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) {
               lablecfg.style.fill = colors.get(key)

--
Gitblit v1.8.0