From c6f7462d80ab626174329b69045fb7e5704c0683 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 05 六月 2021 22:44:17 +0800 Subject: [PATCH] 2021-06-05 --- src/menu/components/chart/antv-pie/index.jsx | 146 +++++++++++++++++++++++++++--------------------- 1 files changed, 81 insertions(+), 65 deletions(-) diff --git a/src/menu/components/chart/antv-pie/index.jsx b/src/menu/components/chart/antv-pie/index.jsx index 9af66e2..343f9ae 100644 --- a/src/menu/components/chart/antv-pie/index.jsx +++ b/src/menu/components/chart/antv-pie/index.jsx @@ -289,11 +289,13 @@ value: percent, } }) - .style({ - lineWidth: 1, - stroke: '#fff', - }) + if (plot.splitLine) { + chart1.style({ + lineWidth: plot.splitLine, + stroke: plot.splitColor, + }) + } if (plot.label !== 'false') { chart1.label(type, { offset: -10, @@ -330,68 +332,71 @@ value: value } }) - .style({ - lineWidth: 1, - stroke: '#fff', - }) - if (plot.label !== 'false') { - if (plot.label === 'inner') { - chart2.label(Y_axis, { - offset: -30, - content: (data) => { - let _label = '' - let _val = '' - if (plot.show !== 'value') { - _val = `${(data[Y_axis] * 100).toFixed(2)}%` - } else { - _val = `${data[Y_axis]}` - } - if (plot.label === 'inner') { - _label = _val - } else { - _label = `${data[X_axis]}: ${_val}` - } - return _label - }, - style: { - textAlign: 'center', - fontSize: 16, - shadowBlur: 2, - shadowColor: 'rgba(0, 0, 0, .45)', - fill: '#fff', + if (plot.splitLine) { + chart2.style({ + lineWidth: plot.splitLine, + stroke: plot.splitColor, + }) + } + + if (plot.label !== 'false') { + if (plot.label === 'inner') { + chart2.label(Y_axis, { + offset: -30, + content: (data) => { + let _label = '' + let _val = '' + if (plot.show !== 'value') { + _val = `${(data[Y_axis] * 100).toFixed(2)}%` + } else { + _val = `${data[Y_axis]}` } - }) - } else { - chart2.label(Y_axis, { - layout: { type: 'pie-spider' }, - labelHeight: 20, - content: (data) => { - let _label = '' - let _val = '' - if (plot.show !== 'value') { - _val = `${(data[Y_axis] * 100).toFixed(2)}%` - } else { - _val = `${data[Y_axis]}` - } - if (plot.label === 'inner') { - _label = _val - } else { - _label = `${data[X_axis]}: ${_val}` - } - return _label - }, - labelLine: { - style: { - lineWidth: 0.5, - }, - }, - style: { - fill: color + if (plot.label === 'inner') { + _label = _val + } else { + _label = `${data[X_axis]}: ${_val}` } - }) - } + return _label + }, + style: { + textAlign: 'center', + fontSize: 16, + shadowBlur: 2, + shadowColor: 'rgba(0, 0, 0, .45)', + fill: '#fff', + } + }) + } else { + chart2.label(Y_axis, { + layout: { type: 'pie-spider' }, + labelHeight: 20, + content: (data) => { + let _label = '' + let _val = '' + if (plot.show !== 'value') { + _val = `${(data[Y_axis] * 100).toFixed(2)}%` + } else { + _val = `${data[Y_axis]}` + } + if (plot.label === 'inner') { + _label = _val + } else { + _label = `${data[X_axis]}: ${_val}` + } + return _label + }, + labelLine: { + style: { + lineWidth: 0.5, + }, + }, + style: { + fill: color + } + }) } + } if (plot.interaction && plot.interaction.length) { plot.interaction.forEach(t => { @@ -488,6 +493,7 @@ }) } + // 楗煎浘鎴栫幆鍥� if (plot.shape !== 'nightingale') { let _chart = chart .interval() @@ -503,6 +509,14 @@ value: value } }) + + if (plot.splitLine) { + _chart.style({ + lineWidth: plot.splitLine, + stroke: plot.splitColor, + }) + } + if (plot.label !== 'false') { if (plot.label === 'inner') { _chart.label(Y_axis, { @@ -578,9 +592,11 @@ } _chart.label(X_axis, _label) - .style({ - lineWidth: 1, - stroke: '#fff', + } + if (plot.splitLine) { + _chart.style({ + lineWidth: plot.splitLine, + stroke: plot.splitColor, }) } } -- Gitblit v1.8.0