king
2021-12-30 598d1cf91acd6d0c2782ae896b6eb78044eaf3e6
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -126,7 +126,7 @@
      _config.plot.hasBar = Bar_axis.length > 0
      if (_config.plot.mutilBar !== 'overlap') {
      if (_config.plot.mutilBar !== 'overlap' && Bar_axis.length > 1) {
        _config.plot.Bar_axis = Bar_axis
      }
    } else {
@@ -237,7 +237,8 @@
      let axisIndex = 0
      let fields = []
      let legends = []
      let vFieldsShow = {}
      _config.plot.customs.forEach(item => {
        if (colors.has(item.name)) {
          item.color = colors.get(item.name)
@@ -294,10 +295,19 @@
          name: item.name,
          marker: { symbol: item.chartType === 'bar' ? 'square' : 'hyphen', style: { stroke: item.color,fill: item.color, r: 5, lineWidth: 2 } }
        })
        if ((!_config.plot.Bar_axis || item.chartType !== 'bar') && item.show) { // 折线图或重叠下的柱状图可单独设置显示类型
          vFieldsShow[item.type] = item.show
        }
      })
      _config.plot.customs = fields
      _config.plot.legends = legends
      _config.plot.axisIndex = axisIndex
      vFields.forEach(item => {
        if (vFieldsShow[item.field]) {
          item.show = vFieldsShow[item.field]
        }
      })
    }
    this.setState({
@@ -1308,7 +1318,7 @@
    view2.data(dv.rows)
    view2.legend(false)
    plot.customs.forEach((item, i) => {
    plot.customs.forEach(item => {
      if (item.chartType === 'bar' && !plot.Bar_axis) {
        view2.axis(item.name, item.axis)
      
@@ -1333,7 +1343,7 @@
          .tooltip(`${item.name}`, (value) => {
            return {
              name: item.name,
              value: plot.show === 'percent' ? value + '%' : value
              value: item.show === 'percent' ? value + '%' : value
            }
          })
@@ -1342,7 +1352,7 @@
        }
        if (item.label !== 'false') {
          _chart.label(item.name, (value) => {
            if (plot.show === 'percent') {
            if (item.show === 'percent') {
              value = value + '%'
            }
            if (plot.label === 'true' && plot.labelColor === 'custom' && item.color) {
@@ -1384,13 +1394,13 @@
          .tooltip(`${item.name}`, (value) => {
            return {
              name: item.name,
              value: plot.show === 'percent' ? value + '%' : value
              value: item.show === 'percent' ? value + '%' : value
            }
          })
        if (item.label === 'true') {
          _chart.label(item.name, (value) => {
            if (plot.show === 'percent') {
            if (item.show === 'percent') {
              value = value + '%'
            }
            return {