From f830c733cbc071f023c9a9a4e1571b7c81d672bf Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 12 十一月 2020 11:47:33 +0800 Subject: [PATCH] 2020-11-12 --- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 36 +++++++++++------------------------- 1 files changed, 11 insertions(+), 25 deletions(-) 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 d16b55b..e249816 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -127,14 +127,8 @@ }, () => { if (config.setting.sync !== 'true' && config.setting.onload === 'true') { this.loadData() - } else if (config.setting.sync === 'true') { - if (!_data) { - this.setState({ - loading: true - }) - } else { - this.handleData() - } + } else if (config.setting.sync === 'true' && _data) { + this.handleData() } }) } @@ -158,7 +152,7 @@ _data = nextProps.data[config.dataName] || [] } - this.setState({sync: false, loading: false, data: _data}, () => { + this.setState({sync: false, data: _data}, () => { this.handleData() }) } else if (!is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { @@ -351,22 +345,6 @@ }) _data = [..._mdata.values()] - } - - if (plot.correction && plot.chartType === 'bar' && _data.length > 0 && _data.length < plot.correction) { - if (plot.enabled !== 'true' || (plot.customs && plot.customs.filter(cell => cell.chartType !== 'bar').length === 0)) { - let _num = plot.correction - _data.length - for (let i = 0; i < _num; i++) { - let _val = Array( i + 2 ).join(' ') - let _cell = {} - _cell[plot.Xaxis] = _val - vFields.forEach(col => { - _cell[col.field] = '' - }) - - _data.push(_cell) - } - } } this.setState({empty: _data.length === 0}) @@ -1003,6 +981,10 @@ if (plot.label === 'true') { _chart.label(_valfield) } + + if (plot.barSize || plot.correction) { + _chart.size(plot.barSize || 35) + } } else if (plot.adjust === 'stack') { let _chart = chart .interval() @@ -1020,6 +1002,10 @@ if (plot.label === 'true') { _chart.label(_valfield) } + + if (plot.barSize || plot.correction) { + _chart.size(plot.barSize || 35) + } } chart.render() -- Gitblit v1.8.0