From 610916b0e897c4953310bac7c0a9a37c7379ffc0 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 25 五月 2021 16:29:13 +0800 Subject: [PATCH] 2021-05-25 --- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 22 +++++++++++++--------- 1 files changed, 13 insertions(+), 9 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 faacd7a..7ac9593 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -95,13 +95,14 @@ }) } + let height = config.plot.height || 400 if (config.plot.title || config.search.length > 0) { - _config.plot.height = _config.plot.height - 80 + _config.plot.height = height - 70 } else { - _config.plot.height = _config.plot.height - 30 + _config.plot.height = height - 25 } - _config.style.height = config.plot.height || 400 + _config.style.height = height let transfield = {} _config.columns.forEach(col => { @@ -763,7 +764,7 @@ const chart = new Chart({ container: this.state.chartId, autoFit: true, - height: plot.height || 400 + height: plot.height }) chart.data(_data) @@ -905,7 +906,7 @@ const chart = new Chart({ container: this.state.chartId, autoFit: true, - height: plot.height || 400 + height: plot.height }) let _data = dv.rows @@ -1110,7 +1111,7 @@ const chart = new Chart({ container: this.state.chartId, autoFit: true, - height: plot.height || 400 + height: plot.height }) // dodge is not support linear attribute, please use category attribute! 鏃堕棿鏍煎紡 @@ -1129,7 +1130,7 @@ chart.scale(_valfield, { nice: true, - range: [0, 0.93] + range: [0, 0.9] }) // 鍧愭爣杞存牸寮忓寲 @@ -1164,8 +1165,10 @@ }) } + let offset = {offsetY: 5} if (plot.transpose === 'true') { chart.coordinate().transpose() + offset = {offsetY: 0, offsetX: -10} } if (plot.coordinate === 'polar') { @@ -1215,7 +1218,8 @@ content: value, style: { fill: plot.color - } + }, + ...offset } }) } @@ -1369,7 +1373,7 @@ } })} </div> - <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> + <div className={'canvas' + (empty ? ' empty' : '')} style={{height: config.plot.height + 25}} id={this.state.chartId}></div> </div> {empty ? <Empty description={false}/> : null} </div> -- Gitblit v1.8.0