| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | this.viewrender() |
| | | MKEmitter.addListener('tabsChange', this.handleTabsChange) |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | |
| | | setTimeout(() => { |
| | | this.viewrender() |
| | | }, 1000) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | const chart = new Chart({ |
| | | container: card.uuid + 'dashboard', |
| | | autoFit: true, |
| | | height: plot.title ? plot.height - 45 : plot.height, |
| | | height: this.wrap.offsetHeight - 30, |
| | | }) |
| | | |
| | | chart.data(data) |
| | |
| | | getdata = () => { |
| | | const { card } = this.state |
| | | |
| | | const data = []; |
| | | const val = (Math.random() * card.plot.maxValue).toFixed(1); |
| | | data.push({ value: +val }); |
| | | return data; |
| | | const data = [] |
| | | const val = (Math.random() * card.plot.maxValue).toFixed(1) |
| | | data.push({ value: +val }) |
| | | return data |
| | | } |
| | | |
| | | dashboardrender = () => { |
| | |
| | | const chart = new Chart({ |
| | | container: card.uuid + 'dashboard', |
| | | autoFit: true, |
| | | height: plot.title ? plot.height - 45 : plot.height, |
| | | height: this.wrap.offsetHeight - 30, |
| | | padding: [0, 0, 0, 0], |
| | | }) |
| | | chart.data(data) |
| | |
| | | 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) => { |
| | |
| | | <Icon type="tool" /> |
| | | </Popover> |
| | | {card.plot.title ? <NormalHeader config={card} updateComponent={this.updateComponent}/> : null} |
| | | <div className="canvas" id={card.uuid + 'dashboard'}></div> |
| | | <div className="canvas" id={card.uuid + 'dashboard'} ref={ref => this.wrap = ref}></div> |
| | | </div> |
| | | ) |
| | | } |