king
2023-02-08 1f6d49bf15e6b50eeee1edc32022eb006b401835
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -1499,6 +1499,8 @@
            barcolors[item[plot.Xaxis]] = plot.barcolors[i].color
          }
        })
      } else {
        barcolors = null
      }
      const ds = new DataSet()
@@ -1633,16 +1635,28 @@
      if (plot.$colors) {
        let limit = chartColors.length
        _chart.color(`${_typefield}*${plot.Xaxis}`, (key, label) => {
          if (barcolors[label]) {
            return barcolors[label]
          } else if (plot.$colors.has(key)) {
            return plot.$colors.get(key)
          } else {
            colorIndex++
            return chartColors[(colorIndex - 1) % limit]
          }
        })
        if (barcolors) {
          _chart.color(`${_typefield}*${plot.Xaxis}`, (key, label) => {
            if (barcolors[label]) {
              return barcolors[label]
            } else if (plot.$colors.has(key)) {
              return plot.$colors.get(key)
            } else {
              colorIndex++
              return chartColors[(colorIndex - 1) % limit]
            }
          })
        } else {
          _chart.color(`${_typefield}`, (key) => {
            if (plot.$colors.has(key)) {
              return plot.$colors.get(key)
            } else {
              colorIndex++
              return chartColors[(colorIndex - 1) % limit]
            }
          })
        }
      } else {
        _chart.color(_typefield)
      }
@@ -1697,16 +1711,27 @@
      if (plot.$colors) {
        let limit = chartColors.length
        _chart.color(`${_typefield}*${plot.Xaxis}`, (key, label) => {
          if (barcolors[label]) {
            return barcolors[label]
          } else if (plot.$colors.has(key)) {
            return plot.$colors.get(key)
          } else {
            colorIndex++
            return chartColors[(colorIndex - 1) % limit]
          }
        })
        if (barcolors) {
          _chart.color(`${_typefield}*${plot.Xaxis}`, (key, label) => {
            if (barcolors[label]) {
              return barcolors[label]
            } else if (plot.$colors.has(key)) {
              return plot.$colors.get(key)
            } else {
              colorIndex++
              return chartColors[(colorIndex - 1) % limit]
            }
          })
        } else {
          _chart.color(`${_typefield}`, (key) => {
            if (plot.$colors.has(key)) {
              return plot.$colors.get(key)
            } else {
              colorIndex++
              return chartColors[(colorIndex - 1) % limit]
            }
          })
        }
      } else {
        _chart.color(_typefield)
      }