| | |
| | | _element.innerHTML = '' |
| | | } |
| | | |
| | | setTimeout(this.viewrender, 100) |
| | | this.$timer && clearTimeout(this.$timer) |
| | | this.$timer = setTimeout(this.viewrender, 100) |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | linerender = () => { |
| | | const { card } = this.state |
| | | let plot = {...card.plot, height: card.plot.height - 80} // 去除title所占空间 |
| | | let plot = {...card.plot, height: card.plot.height - 70} // 去除title所占空间 |
| | | let color = plot.color || 'rgba(0, 0, 0, 0.65)' |
| | | let X_axis = plot.Xaxis || 'x' |
| | | let Y_axis = plot.Yaxis || ['y'] |
| | |
| | | } |
| | | chart.scale('value', { |
| | | nice: true, |
| | | range: [0, 0.93] |
| | | range: [0, 0.9] |
| | | }) |
| | | |
| | | if (!plot.legend || plot.legend === 'hidden') { |
| | |
| | | */ |
| | | customrender = (data) => { |
| | | let card = fromJS(this.state.card).toJS() |
| | | let plot = {...card.plot, height: card.plot.height - 80} // 去除title所占空间 |
| | | let plot = {...card.plot, height: card.plot.height - 70} // 去除title所占空间 |
| | | let color = plot.color || 'rgba(0, 0, 0, 0.65)' |
| | | let fields = [] |
| | | let legends = [] |
| | |
| | | |
| | | chart.scale(item.name, { |
| | | nice: true, |
| | | range: [0, 0.93] |
| | | range: [0, 0.9] |
| | | }) |
| | | |
| | | if (item.chartType === 'bar') { |
| | |
| | | */ |
| | | barrender = () => { |
| | | const { card } = this.state |
| | | let plot = {...card.plot, height: card.plot.height - 80} |
| | | let plot = {...card.plot, height: card.plot.height - 70} |
| | | let color = plot.color || 'rgba(0, 0, 0, 0.65)' |
| | | let X_axis = plot.Xaxis || 'x' |
| | | let Y_axis = plot.Yaxis || ['y'] |
| | |
| | | autoFit: true, |
| | | height: plot.height || 400 |
| | | }) |
| | | |
| | | |
| | | chart.data(dv.rows) |
| | | |
| | | // chart.axis(X_axis, { label: { style: { fill: color } }, tickLine: {style: { stroke: color }}, line: { style: { stroke: color } } }) |
| | |
| | | |
| | | chart.scale('value', { |
| | | nice: true, |
| | | range: [0, 0.93] |
| | | range: [0, 0.9] |
| | | }) |
| | | |
| | | if (!plot.legend || plot.legend === 'hidden') { |
| | |
| | | |
| | | updateComponent = (component) => { |
| | | const card = fromJS(this.state.card).toJS() |
| | | let refresh = false |
| | | if (!is(fromJS(component.plot), fromJS(card.plot)) || !is(fromJS(component.style), fromJS(card.style))) { |
| | | let _element = document.getElementById(card.uuid + 'canvas') |
| | | if (_element) { |
| | | _element.innerHTML = '' |
| | | } |
| | | refresh = true |
| | | this.$timer && clearTimeout(this.$timer) |
| | | this.$timer = setTimeout(() => { |
| | | this.viewrender() |
| | | }, 150) |
| | | } |
| | | |
| | | component.width = component.plot.width |
| | |
| | | |
| | | this.setState({ |
| | | card: component |
| | | }, () => { |
| | | if (refresh) { |
| | | setTimeout(() => { |
| | | this.viewrender() |
| | | }, 100) |
| | | } |
| | | }) |
| | | this.props.updateConfig(component) |
| | | } |