king
2020-10-26 1b89aa4493d1c9768447f2f480d594cdb8077fdc
src/menu/components/chart/antv-pie/index.jsx
@@ -40,7 +40,12 @@
        shape: card.subtype, // 图表类型
        width: 12,
        height: 400,
        label: 'outer',
        name: card.name
      }
      if (card.subtype === 'ring') {
        _plot.innerRadius = 50
      }
      let dataName = ''
@@ -153,14 +158,8 @@
  pierender = () => {
    const { card } = this.state
    let plot = {...card.plot, height: card.plot.height - 80}
    // let color = plot.color || 'rgba(0, 0, 0, 0.85)'
    let color = plot.color || 'rgba(0, 0, 0, 0.85)'
    let transfield = {}
    card.columns.forEach(col => {
      if (col.field) {
        transfield[col.field] = col.label
      }
    })
    let X_axis = plot.Xaxis || 'x'
    let Y_axis = plot.Yaxis || 'y'
@@ -197,12 +196,12 @@
    if (plot.shape === 'nightingale') {
      chart.coordinate('polar', {
        innerRadius: plot.innerRadius ? (plot.innerRadius / 100) : 0,
        radius: plot.radius ? (plot.radius / 100) : 0.75,
        radius: plot.radius ? (plot.radius / 100) : 0.85,
      })
    } else {
      chart.coordinate('theta', {
        innerRadius: plot.shape !== 'pie' && plot.innerRadius ? (plot.innerRadius / 100) : 0,
        radius: plot.radius ? (plot.radius / 100) : 0.75,
        radius: plot.radius ? (plot.radius / 100) : 0.85,
      })
    }
@@ -211,10 +210,20 @@
    } else if (plot.shape === 'nightingale') {
      chart.legend(X_axis, {
        position: plot.legend,
        itemName: {
          style: {
            fill: color,
          }
        }
      })
    } else {
      chart.legend({
        position: plot.legend
        position: plot.legend,
        itemName: {
          style: {
            fill: color,
          }
        }
      })
    }
@@ -292,6 +301,9 @@
              style: {
                lineWidth: 0.5,
              },
            },
            style: {
              fill: color
            }
          })
        }
@@ -308,8 +320,10 @@
        if (plot.label !== 'false') {
          let _label = {}
          if (plot.label === 'inner') {
            _label = {
              offset: -15,
            _label.offset = -15
          } else {
            _label.style = {
              fill: color
            }
          }