| | |
| | | shape: card.subtype, // 图表类型 |
| | | width: 12, |
| | | height: 400, |
| | | label: 'outer', |
| | | name: card.name |
| | | } |
| | | |
| | | if (card.subtype === 'ring') { |
| | | _plot.innerRadius = 50 |
| | | } |
| | | |
| | | let dataName = '' |
| | |
| | | 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' |
| | | |
| | |
| | | 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, |
| | | }) |
| | | } |
| | | |
| | |
| | | } 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, |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | style: { |
| | | lineWidth: 0.5, |
| | | }, |
| | | }, |
| | | style: { |
| | | fill: color |
| | | } |
| | | }) |
| | | } |
| | |
| | | if (plot.label !== 'false') { |
| | | let _label = {} |
| | | if (plot.label === 'inner') { |
| | | _label = { |
| | | offset: -15, |
| | | _label.offset = -15 |
| | | } else { |
| | | _label.style = { |
| | | fill: color |
| | | } |
| | | } |
| | | |