From 1b89aa4493d1c9768447f2f480d594cdb8077fdc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 26 十月 2020 09:24:19 +0800 Subject: [PATCH] 2020-10-26 --- src/menu/components/chart/antv-pie/index.jsx | 38 ++++++++++++++++++++++++++------------ 1 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx index 2785f76..f8dff44 100644 --- a/src/menu/components/chart/antv-pie/index.jsx +++ b/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 } } -- Gitblit v1.8.0