king
2023-02-06 7090326d3b7faa8122df3808832745e6fdda749b
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -1478,6 +1478,7 @@
    let _valfield = 'value'
    let _typefield = 'key'
    let colorIndex = 0
    let barcolors = {}
    if (plot.datatype === 'statistics') {
      _valfield = plot.InfoValue
@@ -1490,6 +1491,14 @@
      if (plot.enabled === 'true') {
        this.customrender(data)
        return
      }
      if (plot.barcolors && plot.barcolors.length > 0 && plot.Yaxis.length === 1) {
        data.forEach((item, i) => {
          if (plot.barcolors[i]) {
            barcolors[item[plot.Xaxis]] = plot.barcolors[i].color
          }
        })
      }
      const ds = new DataSet()
@@ -1624,8 +1633,10 @@
      if (plot.$colors) {
        let limit = chartColors.length
        _chart.color(_typefield, (key) => {
          if (plot.$colors.has(key)) {
        _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++
@@ -1686,8 +1697,10 @@
      if (plot.$colors) {
        let limit = chartColors.length
        _chart.color(_typefield, (key) => {
          if (plot.$colors.has(key)) {
        _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++