| | |
| | | }, () => { |
| | | 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() |
| | | } |
| | | }) |
| | | } |
| | |
| | | _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))) { |
| | |
| | | }) |
| | | |
| | | _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}) |
| | |
| | | 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() |
| | |
| | | if (plot.label === 'true') { |
| | | _chart.label(_valfield) |
| | | } |
| | | |
| | | if (plot.barSize || plot.correction) { |
| | | _chart.size(plot.barSize || 35) |
| | | } |
| | | } |
| | | |
| | | chart.render() |