| | |
| | | import { Popover, notification } from 'antd' |
| | | import { ToolOutlined, DeleteOutlined, FontColorsOutlined, PlusCircleOutlined } from '@ant-design/icons' |
| | | import { Chart } from '@antv/g2' |
| | | import DataSet from '@antv/data-set' |
| | | import * as echarts from 'echarts' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | if (card.plot.chartType === 'antv') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('Chart', 'DataSet', 'wrap', 'data', 'config', card.plot.script) |
| | | func(Chart, DataSet, this.wrap, [], card) |
| | | let func = new Function('Chart', 'chartId', 'data', 'config', card.plot.script) |
| | | func(Chart, card.uuid + 'canvas', [], card) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | |
| | |
| | | } else if (card.plot.chartType === 'echarts') { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('echarts', 'DataSet', 'wrap', 'data', 'config', card.plot.script) |
| | | func(echarts, DataSet, this.wrap, [], card) |
| | | let func = new Function('echarts', 'chartId', 'data', 'config', card.plot.script) |
| | | func(echarts, card.uuid + 'canvas', [], card) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | |
| | |
| | | </Popover> |
| | | <NormalHeader config={card} updateComponent={this.updateComponent}/> |
| | | <div className="canvas-wrap" style={{height: card.plot.height}}> |
| | | <div className="canvas" id={card.uuid + 'canvas'} style={{height: getHeight(card.plot.height)}} ref={ref => this.wrap = ref}></div> |
| | | <div className="canvas" id={card.uuid + 'canvas'} style={{height: getHeight(card.plot.height)}}></div> |
| | | </div> |
| | | <div className="component-name"> |
| | | <div className="center"> |