king
2021-06-10 b656f58958a5ca54e710b980b98f4b542ff6369f
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++