From 1b6086e0fb66410fb237e6893f791a26bf2e7ff1 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 22 十一月 2023 10:37:00 +0800
Subject: [PATCH] 2023-11-22

---
 src/tabviews/custom/components/chart/antv-bar-line/index.jsx |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
index 0566da8..369255d 100644
--- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -100,6 +100,10 @@
     _config.style.height = 'auto'
     _config.style.minHeight = _config.plot.height + 30
 
+    if (!_config.plot.legend || _config.plot.legend === 'hidden') {
+      _config.plot.legend = false
+    }
+
     if (_config.plot.title) {
       _config.style.minHeight = _config.style.minHeight + 45
     }
@@ -1050,7 +1054,7 @@
     chart.axis(plot.Xaxis, plot.$xc)
     chart.axis(_valfield, plot.$yc)
 
-    if (!plot.legend || plot.legend === 'hidden') {
+    if (!plot.legend) {
       chart.legend(false)
     } else {
       chart.legend({
@@ -1225,7 +1229,7 @@
 
       if (!isNaN(max)) {
         max = Math.ceil(max)
-        let s = Math.pow(10, (max + '').length - 1)
+        let s = max > 10 ? Math.pow(10, (max + '').length - 2) : 1
         max = Math.ceil(max / s) * s
       } else {
         max = 0
@@ -1266,8 +1270,7 @@
       })
     }
 
-    let noLegend = !plot.legend || plot.legend === 'hidden'
-    if (noLegend) {
+    if (!plot.legend) {
       chart.legend(false)
     } else {
       chart.legend({
@@ -1361,7 +1364,7 @@
       view1.scale('value', c)
       view1.axis('value', plot.$yc)
   
-      if (!noLegend) {
+      if (plot.legend) {
         view1.legend(false)
       }
 
@@ -1514,7 +1517,7 @@
 
     view2.data(dv.rows)
 
-    if (!noLegend) {
+    if (plot.legend && plot.Bar_axis) {
       view2.legend(false)
     }
 
@@ -1765,7 +1768,7 @@
     chart.axis(plot.Xaxis, plot.$xc)
     chart.axis(_valfield, plot.$yc)
 
-    if (!plot.legend || plot.legend === 'hidden') {
+    if (!plot.legend) {
       chart.legend(false)
     } else {
       chart.legend({

--
Gitblit v1.8.0