king
2021-06-05 c6f7462d80ab626174329b69045fb7e5704c0683
src/menu/components/chart/antv-bar/index.jsx
@@ -75,7 +75,7 @@
        parentId: card.parentId || '',
        format: 'array',   // 组件属性 - 数据格式
        pageable: false,   // 组件属性 - 是否可分页
        switchable: false, // 组件属性 - 数据是否可切换
        switchable: card.type === 'bar' ? true : false, // 组件属性 - 数据是否可切换
        dataName: card.dataName || '',
        width: _plot.width,
        name: _plot.name,
@@ -348,6 +348,23 @@
          .color('key')
          .size(3)
          .shape('circle')
      }
      if (plot.area === 'true') {
        let area = chart.area().shape(plot.shape || 'smooth').position(`${X_axis}*value`).tooltip(false)
        if (plot.colors && plot.colors.length > 0) {
          let limit = chartColors.length
          area.color('key', (key) => {
            if (colors.has(key)) {
              return colors.get(key)
            } else {
              colorIndex++
              return chartColors[(colorIndex - 1) % limit]
            }
          })
        } else {
          area.color('key')
        }
      }
      if (plot.interaction && plot.interaction.length) {
@@ -926,6 +943,15 @@
        if (plot.barSize || plot.correction) {
          _chart.size(plot.barSize || 35)
        }
        if (plot.selectColor) {
          _chart.state({
            selected: {
              style: {
                fill: plot.selectColor,
              }
            }
          })
        }
        if (plot.barRadius) {
          _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] })
        }
@@ -975,6 +1001,15 @@
        if (plot.barSize || plot.correction) {
          _chart.size(plot.barSize || 35)
        }
        if (plot.selectColor) {
          _chart.state({
            selected: {
              style: {
                fill: plot.selectColor,
              }
            }
          })
        }
        if (plot.barRadius) {
          _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] })
        }