From cc1d7095ec6df622efbdaaabe3dec78ca3599d90 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 27 五月 2022 17:01:14 +0800
Subject: [PATCH] X轴自定义名称长度

---
 src/tabviews/custom/components/chart/antv-bar-line/index.jsx |    6 ++++--
 1 files changed, 4 insertions(+), 2 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 6c687f2..f45afc1 100644
--- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
+++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -198,12 +198,14 @@
       _config.plot.$colors = colors
     }
 
+    let limit = _config.plot.XLimit || 11
+
     let xc = {label: {
       formatter: (val) => {
         if (!val || /^\s*$/.test(val)) return val
         let _val = `${val}`
-        if (_val.length <= 11) return val
-        return _val.substring(0, 8) + '...'
+        if (_val.length <= limit) return val
+        return _val.substring(0, limit) + '...'
       },
       style: { fill: _config.plot.color }
     }}

--
Gitblit v1.8.0