From da5ff4b9866a2d458d950f0c743ab9244e16c66d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 12 十一月 2023 12:23:08 +0800
Subject: [PATCH] 2023-11-12

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

diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx
index 332e3ab..ad556b3 100644
--- a/src/menu/components/chart/antv-bar/index.jsx
+++ b/src/menu/components/chart/antv-bar/index.jsx
@@ -550,7 +550,8 @@
       })
     }
 
-    if (!plot.legend || plot.legend === 'hidden') {
+    let noLegend = !plot.legend || plot.legend === 'hidden'
+    if (noLegend) {
       chart.legend(false)
     } else {
       chart.legend({
@@ -643,7 +644,9 @@
       }
       view1.axis('value', yc)
   
-      // view1.legend(false)
+      if (!noLegend) {
+        view1.legend(false)
+      }
   
       if (plot.mutilBar !== 'stack') {
         let _chart = view1
@@ -770,7 +773,9 @@
 
     view2.data(dv.rows)
 
-    // view2.legend(false)
+    if (!noLegend) {
+      view2.legend(false)
+    }
 
     fields.forEach(item => {
       if (item.chartType === 'bar' && !Bar_axis.length) {

--
Gitblit v1.8.0