From b656f58958a5ca54e710b980b98f4b542ff6369f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 10 六月 2021 18:58:21 +0800 Subject: [PATCH] 2021-06-10 --- src/menu/components/chart/antv-bar/index.jsx | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index 60156f0..f6d5eaa 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -292,9 +292,13 @@ if (plot.colors && plot.colors.length > 0) { if (plot.ramp === 'true') { + let _s = 'l(0) ' + if (plot.rampDirection === 'vertical') { + _s = 'l(90) ' + } plot.colors.forEach(item => { if (!colors.has(transfield[item.type])) { - colors.set(transfield[item.type], `l(0) 0:${item.color} 1:${item.color1}` ) + colors.set(transfield[item.type], `${_s}0:${item.color} 1:${item.color1}` ) } }) } else { @@ -324,6 +328,9 @@ let limit = chartColors.length _chart.color('key', (key) => { if (colors.has(key)) { + if (plot.area === 'true' && plot.rampDirection === 'vertical') { + return colors.get(key).replace(/l\(9?0\) 0:|\s1:.*/ig, '') + } return colors.get(key) } else { colorIndex++ -- Gitblit v1.8.0