| | |
| | | _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'] |
| | |
| | | |
| | | 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) |
| | | } |
| | |
| | | |
| | | .canvas { |
| | | margin: 0px; |
| | | // padding: 20px 15px 15px; |
| | | padding: 15px; |
| | | padding: 15px 10px 10px; |
| | | letter-spacing: 0px; |
| | | min-height: calc(100% - 45px); |
| | | } |
| | | |
| | | .chart-header { |
| | |
| | | _element.innerHTML = '' |
| | | } |
| | | |
| | | setTimeout(this.dashboardrender, 100) |
| | | this.$timer && clearTimeout(this.$timer) |
| | | this.$timer = setTimeout(this.dashboardrender, 100) |
| | | } |
| | | } |
| | | |
| | |
| | | const chart = new Chart({ |
| | | container: card.uuid + 'dashboard', |
| | | autoFit: true, |
| | | height: plot.height ? (plot.height - 80) : 320, |
| | | height: plot.height ? (plot.height - 75) : 325, |
| | | padding: [0, 0, 0, 0], |
| | | }) |
| | | chart.data(data); |
| | |
| | | |
| | | 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 + 'dashboard') |
| | | if (_element) { |
| | | _element.innerHTML = '' |
| | | } |
| | | refresh = true |
| | | this.$timer && clearTimeout(this.$timer) |
| | | this.$timer = setTimeout(() => { |
| | | this.dashboardrender() |
| | | }, 150) |
| | | } |
| | | |
| | | component.width = component.plot.width |
| | |
| | | |
| | | this.setState({ |
| | | card: component |
| | | }, () => { |
| | | if (refresh) { |
| | | setTimeout(() => { |
| | | this.dashboardrender() |
| | | }, 100) |
| | | } |
| | | }) |
| | | this.props.updateConfig(component) |
| | | } |
| | |
| | | |
| | | .canvas { |
| | | margin: 0px; |
| | | padding: 15px; |
| | | letter-spacing: 0px; |
| | | min-height: calc(100% - 45px); |
| | | } |
| | | |
| | | >.anticon-tool { |
| | |
| | | _element.innerHTML = '' |
| | | } |
| | | |
| | | setTimeout(this.pierender, 100) |
| | | this.$timer && clearTimeout(this.$timer) |
| | | this.$timer = setTimeout(this.pierender, 100) |
| | | } |
| | | } |
| | | |
| | |
| | | const chart = new Chart({ |
| | | container: card.uuid + 'canvas', |
| | | autoFit: true, |
| | | height: card.plot.height ? (card.plot.height - 80) : 320 |
| | | height: card.plot.height ? (card.plot.height - 75) : 325 |
| | | }) |
| | | |
| | | if (plot.shape !== 'nightingale' && plot.show !== 'value') { |
| | |
| | | |
| | | 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.pierender() |
| | | }, 150) |
| | | } |
| | | |
| | | component.width = component.plot.width |
| | |
| | | |
| | | this.setState({ |
| | | card: component |
| | | }, () => { |
| | | if (refresh) { |
| | | setTimeout(() => { |
| | | this.pierender() |
| | | }, 100) |
| | | } |
| | | }) |
| | | this.props.updateConfig(component) |
| | | } |
| | |
| | | margin: 0px; |
| | | padding: 15px; |
| | | letter-spacing: 0px; |
| | | min-height: calc(100% - 45px); |
| | | } |
| | | |
| | | >.anticon-tool { |
| | |
| | | _element.innerHTML = '' |
| | | } |
| | | |
| | | setTimeout(this.ponitrender, 100) |
| | | this.$timer && clearTimeout(this.$timer) |
| | | this.$timer = setTimeout(this.ponitrender, 100) |
| | | } |
| | | } |
| | | |
| | |
| | | const chart = new Chart({ |
| | | container: card.uuid + 'canvas', |
| | | autoFit: true, |
| | | height: plot.height - 80 |
| | | height: plot.height - 70 |
| | | }) |
| | | |
| | | chart.data(data); |
| | |
| | | |
| | | 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.ponitrender() |
| | | }, 150) |
| | | } |
| | | |
| | | component.width = component.plot.width |
| | |
| | | |
| | | this.setState({ |
| | | card: component |
| | | }, () => { |
| | | if (refresh) { |
| | | setTimeout(() => { |
| | | this.ponitrender() |
| | | }, 100) |
| | | } |
| | | }) |
| | | this.props.updateConfig(component) |
| | | } |
| | |
| | | |
| | | .canvas { |
| | | margin: 0px; |
| | | // padding: 20px 15px 15px; |
| | | padding: 15px; |
| | | padding: 15px 10px 10px; |
| | | letter-spacing: 0px; |
| | | min-height: calc(100% - 45px); |
| | | } |
| | | |
| | | .chart-header { |
| | |
| | | .group-shell-inner { |
| | | margin: -8px; |
| | | margin: 0px; |
| | | |
| | | >.ant-col { |
| | | padding: 8px; |
| | | } |
| | | .anticon { |
| | | cursor: unset; |
| | | } |
| | |
| | | .tab-shell-inner { |
| | | margin: -8px; |
| | | margin: 0px; |
| | | |
| | | >.ant-col { |
| | | padding: 8px; |
| | | } |
| | | .anticon { |
| | | cursor: unset; |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | 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 => { |
| | |
| | | const chart = new Chart({ |
| | | container: this.state.chartId, |
| | | autoFit: true, |
| | | height: plot.height || 400 |
| | | height: plot.height |
| | | }) |
| | | |
| | | chart.data(_data) |
| | |
| | | const chart = new Chart({ |
| | | container: this.state.chartId, |
| | | autoFit: true, |
| | | height: plot.height || 400 |
| | | height: plot.height |
| | | }) |
| | | |
| | | let _data = dv.rows |
| | |
| | | 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! 时间格式 |
| | |
| | | |
| | | chart.scale(_valfield, { |
| | | nice: true, |
| | | range: [0, 0.93] |
| | | range: [0, 0.9] |
| | | }) |
| | | |
| | | // 坐标轴格式化 |
| | |
| | | }) |
| | | } |
| | | |
| | | let offset = {offsetY: 5} |
| | | if (plot.transpose === 'true') { |
| | | chart.coordinate().transpose() |
| | | offset = {offsetY: 0, offsetX: -10} |
| | | } |
| | | |
| | | if (plot.coordinate === 'polar') { |
| | |
| | | content: value, |
| | | style: { |
| | | fill: plot.color |
| | | } |
| | | }, |
| | | ...offset |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | })} |
| | | </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> |
| | |
| | | .canvas-wrap { |
| | | margin: 0 0px; |
| | | position: relative; |
| | | min-height: calc(100% - 45px); |
| | | .chart-action { |
| | | position: absolute; |
| | | top: 0px; |
| | |
| | | |
| | | .canvas { |
| | | margin: 0; |
| | | padding: 20px 15px 15px; |
| | | padding: 15px 10px 10px; |
| | | letter-spacing: 0px; |
| | | } |
| | | .canvas.empty { |
| | |
| | | _sync = false |
| | | } |
| | | |
| | | _config.style.height = config.plot.height || 400 |
| | | let height = config.plot.height || 400 |
| | | if (config.plot.title) { |
| | | _config.plot.height = height - 75 |
| | | } else { |
| | | _config.plot.height = height - 30 |
| | | } |
| | | _config.style.height = height |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | |
| | | const chart = new Chart({ |
| | | container: chartId, |
| | | autoFit: true, |
| | | height: plot.height ? (plot.height - 80) : 320, |
| | | height: plot.height, |
| | | padding: [0, 0, 0, 0], |
| | | }) |
| | | chart.data([_data]); |
| | |
| | | } |
| | | <NormalHeader config={config} /> |
| | | <div className="canvas-wrap"> |
| | | <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> |
| | | <div className={'canvas' + (empty ? ' empty' : '')} style={{height: config.plot.height + 30}} id={this.state.chartId}></div> |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | .canvas-wrap { |
| | | margin: 0 0px; |
| | | position: relative; |
| | | min-height: calc(100% - 45px); |
| | | .chart-action { |
| | | position: absolute; |
| | | top: 2px; |
| | |
| | | _sync = false |
| | | } |
| | | |
| | | 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 - 75 |
| | | } else { |
| | | _config.plot.height = _config.plot.height - 30 |
| | | _config.plot.height = height - 30 |
| | | } |
| | | |
| | | _config.style.height = config.plot.height || 400 |
| | | _config.style.height = height |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | |
| | | const chart = new Chart({ |
| | | container: chartId, |
| | | autoFit: true, |
| | | height: plot.height || 400 |
| | | height: plot.height |
| | | }) |
| | | |
| | | if (plot.shape !== 'nightingale' && plot.show !== 'value') { |
| | |
| | | } |
| | | <NormalHeader config={config} BID={BID} menuType={this.props.menuType} refresh={this.refreshSearch} /> |
| | | <div className="canvas-wrap"> |
| | | <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> |
| | | <div className={'canvas' + (empty ? ' empty' : '')} style={{height: config.plot.height + 30}} id={this.state.chartId}></div> |
| | | </div> |
| | | {empty ? <Empty description={false}/> : null} |
| | | </div> |
| | |
| | | .canvas-wrap { |
| | | margin: 0 0px; |
| | | position: relative; |
| | | min-height: calc(100% - 45px); |
| | | .chart-action { |
| | | position: absolute; |
| | | top: 2px; |
| | |
| | | _sync = false |
| | | } |
| | | |
| | | 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 |
| | | _config.style.height = height |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 折线图渲染 |
| | | * @description 散点图渲染 |
| | | */ |
| | | scatterrender = () => { |
| | | const { plot, data, chartId } = this.state |
| | |
| | | } |
| | | })} |
| | | </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> |
| | |
| | | .canvas-wrap { |
| | | margin: 0 0px; |
| | | position: relative; |
| | | min-height: calc(100% - 45px); |
| | | .chart-action { |
| | | position: absolute; |
| | | top: 0px; |
| | |
| | | |
| | | .canvas { |
| | | margin: 0; |
| | | padding: 20px 15px 15px; |
| | | padding: 15px 10px 10px; |
| | | letter-spacing: 0px; |
| | | } |
| | | .canvas.empty { |