| | |
| | | */ |
| | | 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) |
| | | |
| | |
| | | const chart = new Chart({ |
| | | container: card.uuid + 'canvas', |
| | | autoFit: true, |
| | | height: plot.height || 400 |
| | | height: this.wrap.offsetHeight - 25 |
| | | }) |
| | | |
| | | chart.data(dv.rows) |
| | |
| | | */ |
| | | 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) { |
| | |
| | | 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 } } }) |
| | |
| | | */ |
| | | 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) |
| | | |
| | |
| | | const chart = new Chart({ |
| | | container: card.uuid + 'canvas', |
| | | autoFit: true, |
| | | height: plot.height || 400 |
| | | height: this.wrap.offsetHeight - 25 |
| | | }) |
| | | |
| | | chart.data(dv.rows) |
| | |
| | | <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} |