From 5463821a7f9a9d31a1d4cd553e75652ed7fc8c54 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 05 六月 2021 13:28:25 +0800
Subject: [PATCH] 2021-06-05

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

diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx
index 20201ba..bea61f9 100644
--- a/src/menu/components/chart/antv-bar/index.jsx
+++ b/src/menu/components/chart/antv-bar/index.jsx
@@ -349,6 +349,12 @@
           .size(3)
           .shape('circle')
       }
+
+      if (plot.interaction && plot.interaction.length) {
+        plot.interaction.forEach(t => {
+          chart.interaction(t)
+        })
+      }
       chart.render()
     } else {
       this.customrender(data)
@@ -535,7 +541,6 @@
       })
 
       view1.data(dvt.rows)
-      view1.interaction('other-visible')
       view1.scale('value', {
         nice: true,
         range: [0, 0.9]
@@ -567,7 +572,6 @@
         if (plot.colors && plot.colors.length > 0) {
           let limit = chartColors.length
           _chart.color('key', (key) => {
-            // return 'l(90) 0:#1890ff 1:#70cdd0'
             if (colors.has(key)) {
               return colors.get(key)
             } else {
@@ -659,7 +663,6 @@
     })
 
     view2.data(dv.rows)
-    view2.interaction('other-visible')
 
     view2.legend(false)
 
@@ -755,6 +758,14 @@
         }
       }
     })
+
+    if (plot.interaction && plot.interaction.length) {
+      plot.interaction.forEach(t => {
+        if (t === 'element-active' || t === 'element-highlight') {
+          chart.interaction(t)
+        }
+      })
+    }
 
     chart.render()
   }
@@ -968,6 +979,12 @@
           _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] })
         }
       }
+
+      if (plot.interaction && plot.interaction.length) {
+        plot.interaction.forEach(t => {
+          chart.interaction(t)
+        })
+      }
   
       chart.render()
     } else {

--
Gitblit v1.8.0