Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getEchartsInstance() {
// return the echart object
return echarts.getInstanceByDom(this.refs.echartsDom) || echarts.init(this.refs.echartsDom, this.props.theme)
}
getEchartsInstance() {
// return the echart object
const me = this;
const props = me.props;
const option = props.option;
const theme = props.theme || option.theme;
return echarts.getInstanceByDom(me.wrapper) || echarts.init(me.wrapper, theme);
}
renderEChart = () => {
let chartObj =
echarts.getInstanceByDom(this.refs.chart) ||
echarts.init(this.refs.chart, this.props.theme);
if (this.props.showLoading) {
chartObj.showLoading();
}
chartObj.setOption(this.props.options);
chartObj.hideLoading();
return chartObj;
}
render() {
getEchartsInstance = () => {
if(_.isNil(this.refs.echartsDom)) {
return null
}
return echarts.getInstanceByDom(this.refs.echartsDom) || echarts.init(this.refs.echartsDom, this.props.theme)
}
drawChart() {
const chart = echarts.getInstanceByDom(this.container);
if (!chart) {
this.chart = echarts.init(this.container);
}
this.chart.showLoading();
this.loadData().then(data => {
this.chart.hideLoading();
this.renderChart(data);
}, 3000);
}