From a13b2a8d6e84662275ea913850e01be9b2ff31e5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 13 八月 2021 00:24:31 +0800 Subject: [PATCH] 2021-08-13 --- src/tabviews/custom/components/chart/antv-pie/index.jsx | 22 ++++++++-------------- 1 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 002b51b..145efac 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -11,12 +11,13 @@ import Utils from '@/utils/utils.js' import { modifyTabview } from '@/store/action' import { chartColors } from '@/utils/option.js' -import asyncComponent from '@/utils/asyncComponent' +// import asyncComponent from '@/utils/asyncComponent' import UtilsDM from '@/utils/utils-datamanage.js' import MKEmitter from '@/utils/events.js' +import NormalHeader from '@/tabviews/custom/components/share/normalheader' import './index.scss' -const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) +// const NormalHeader = asyncComponent(() => import('@/tabviews/custom/components/share/normalheader')) class PieChart extends Component { static propTpyes = { @@ -55,14 +56,7 @@ _sync = false } - let height = config.plot.height || 400 - if (config.plot.title || config.search.length > 0) { - _config.plot.height = height - 75 - } else { - _config.plot.height = height - 30 - } - - _config.style.height = height + _config.style.height = config.plot.height || 400 let decimal = 0 _config.columns.forEach(col => { @@ -558,7 +552,7 @@ const chart = new Chart({ container: chartId, autoFit: true, - height: plot.height, + height: this.wrap.offsetHeight - 30, padding: 0, }) @@ -752,7 +746,7 @@ const chart = new Chart({ container: chartId, autoFit: true, - height: plot.height + height: this.wrap.offsetHeight - 30 }) if (plot.shape !== 'nightingale' && plot.show !== 'value') { @@ -1021,8 +1015,8 @@ </div> : null } <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} /> - <div className="canvas-wrap"> - <div className={'canvas' + (empty ? ' empty' : '')} style={{height: config.plot.height + 30}} id={this.state.chartId}></div> + <div className="canvas-wrap" ref={ref => this.wrap = ref}> + <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> </div> {empty ? <Empty description={false}/> : null} </div> -- Gitblit v1.8.0