From e9c48bd7356462ba9257540b130a47a65ad1861d Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 26 八月 2021 17:17:11 +0800 Subject: [PATCH] 2021-08-26 --- src/menu/components/chart/antv-bar/index.jsx | 29 ++++++++--------------------- 1 files changed, 8 insertions(+), 21 deletions(-) diff --git a/src/menu/components/chart/antv-bar/index.jsx b/src/menu/components/chart/antv-bar/index.jsx index 19cd40e..6930709 100644 --- a/src/menu/components/chart/antv-bar/index.jsx +++ b/src/menu/components/chart/antv-bar/index.jsx @@ -198,14 +198,10 @@ */ linerender = () => { const { card } = this.state - let plot = {...card.plot} // 鍘婚櫎title鎵�鍗犵┖闂� + const plot = card.plot let color = plot.color || 'rgba(0, 0, 0, 0.65)' let X_axis = plot.Xaxis || 'x' let Y_axis = plot.Yaxis || ['y'] - - if (card.plot.title || card.search.length > 0) { - plot.height = card.plot.height - 70 - } let data = this.getdata(X_axis, Y_axis) @@ -239,7 +235,7 @@ const chart = new Chart({ container: card.uuid + 'canvas', autoFit: true, - height: plot.height || 400 + height: this.wrap.offsetHeight - 25 }) chart.data(dv.rows) @@ -423,16 +419,12 @@ */ customrender = (data) => { let card = fromJS(this.state.card).toJS() - let plot = {...card.plot} // 鍘婚櫎title鎵�鍗犵┖闂� + let plot = card.plot let color = plot.color || 'rgba(0, 0, 0, 0.65)' let fields = [] let legends = [] let transfield = {} let Bar_axis = [] - - if (card.plot.title || card.search.length > 0) { - plot.height = card.plot.height - 70 - } card.columns.forEach(col => { if (col.field) { @@ -568,7 +560,7 @@ const chart = new Chart({ container: card.uuid + 'canvas', autoFit: true, - height: plot.height || 400, + height: this.wrap.offsetHeight - 25, }) // chart.axis(plot.Xaxis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } }) @@ -920,14 +912,10 @@ */ barrender = () => { const { card } = this.state - let plot = {...card.plot} + const plot = card.plot let color = plot.color || 'rgba(0, 0, 0, 0.65)' let X_axis = plot.Xaxis || 'x' let Y_axis = plot.Yaxis || ['y'] - - if (card.plot.title || card.search.length > 0) { - plot.height = card.plot.height - 70 - } let data = this.getdata(X_axis, Y_axis) @@ -962,7 +950,7 @@ const chart = new Chart({ container: card.uuid + 'canvas', autoFit: true, - height: plot.height || 400 + height: this.wrap.offsetHeight - 25 }) chart.data(dv.rows) @@ -1282,7 +1270,6 @@ newcard.execSuccess = 'grid' newcard.execError = 'never' newcard.popClose = 'never' - newcard.errorTime = 10 newcard.verify = null newcard.show = 'icon' @@ -1293,7 +1280,7 @@ changeStyle = () => { const { card } = this.state - MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style) + MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin', 'shadow'], card.style) } getStyle = (comIds, style) => { @@ -1363,7 +1350,7 @@ <Icon type="tool" /> </Popover> {card.plot.title || card.search.length > 0 ? <NormalHeader config={card} updateComponent={this.updateComponent}/> : null} - <div className="canvas" id={card.uuid + 'canvas'}></div> + <div className="canvas" id={card.uuid + 'canvas'} ref={ref => this.wrap = ref}></div> {appType !== 'mob' ? <ActionComponent type="chart" config={card} -- Gitblit v1.8.0