From ada653685c62e55b2d293f93470eaad59fb5cafb Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期六, 17 四月 2021 11:32:09 +0800 Subject: [PATCH] 2021-04-17 --- src/menu/components/chart/antv-bar/index.jsx | 9 +++++++++ src/tabviews/custom/components/chart/antv-scatter/index.jsx | 2 +- src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 11 +++++++++++ src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 15 ++++++++++----- src/tabviews/custom/components/chart/antv-dashboard/index.jsx | 7 +------ src/tabviews/custom/components/chart/antv-pie/index.jsx | 6 +----- 6 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index 8a0c978..7fdb7a9 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -375,6 +375,17 @@ forbid: !['bar'].includes(card.chartType), required: false }, { + type: 'number', + key: 'barRadius', + label: '鏌卞舰鍦嗚', + tooltip: '鏌卞舰鍥句笂绔渾瑙掋��', + min: 0, + max: 200, + decimal: 0, + initVal: card.barRadius || 0, + forbid: !['bar'].includes(card.chartType), + required: false + }, { type: 'color', key: 'color', label: '鑹茬郴', diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index 2c27c5f..02fd71b 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -511,6 +511,9 @@ } }) } + if (plot.barRadius) { + _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) + } } else if (item.chartType === 'line') { let _chart = chart .line() @@ -703,6 +706,9 @@ if (plot.barSize || plot.correction) { _chart.size(plot.barSize || 35) } + if (plot.barRadius) { + _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) + } } else if (plot.adjust === 'stack') { let _chart = chart .interval() @@ -749,6 +755,9 @@ if (plot.barSize || plot.correction) { _chart.size(plot.barSize || 35) } + if (plot.barRadius) { + _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) + } } chart.render() diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index 73dc126..7d31e61 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -104,11 +104,7 @@ _config.plot.height = _config.plot.height - 30 } - if (_config.style) { - _config.style = {..._config.style, minHeight: (config.plot.height || 400)} - } else { - _config.style = {minHeight: (config.plot.height || 400)} - } + _config.style.height = config.plot.height || 400 let transfield = {} _config.columns.forEach(col => { @@ -1055,6 +1051,9 @@ } }) } + if (plot.barRadius) { + _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) + } } else if (item.chartType === 'line') { let _chart = chart .line() @@ -1277,6 +1276,9 @@ if (plot.barSize || plot.correction) { _chart.size(plot.barSize || 35) } + if (plot.barRadius) { + _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) + } } else if (plot.adjust === 'stack') { let _chart = chart .interval() @@ -1320,6 +1322,9 @@ if (plot.barSize || plot.correction) { _chart.size(plot.barSize || 35) } + if (plot.barRadius) { + _chart.style({ radius: [plot.barRadius, plot.barRadius, 0, 0] }) + } } if (plot.linkmenu && plot.linkmenu.length > 0) { diff --git a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx index 2fe7eb4..f5f337f 100644 --- a/src/tabviews/custom/components/chart/antv-dashboard/index.jsx +++ b/src/tabviews/custom/components/chart/antv-dashboard/index.jsx @@ -86,12 +86,7 @@ _sync = false } - - if (_config.style) { - _config.style = {..._config.style, minHeight: (config.plot.height || 400)} - } else { - _config.style = {minHeight: (config.plot.height || 400)} - } + _config.style.height = config.plot.height || 400 this.setState({ config: _config, diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index c7fbd33..8a74a02 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -61,11 +61,7 @@ _config.plot.height = _config.plot.height - 30 } - if (_config.style) { - _config.style = {..._config.style, minHeight: (config.plot.height || 400)} - } else { - _config.style = {minHeight: (config.plot.height || 400)} - } + _config.style.height = config.plot.height || 400 this.setState({ config: _config, diff --git a/src/tabviews/custom/components/chart/antv-scatter/index.jsx b/src/tabviews/custom/components/chart/antv-scatter/index.jsx index 7781e86..0aa4847 100644 --- a/src/tabviews/custom/components/chart/antv-scatter/index.jsx +++ b/src/tabviews/custom/components/chart/antv-scatter/index.jsx @@ -57,7 +57,7 @@ _config.plot.height = _config.plot.height - 30 } - _config.style = {..._config.style, minHeight: config.plot.height} + _config.style.height = config.plot.height this.setState({ config: _config, -- Gitblit v1.8.0