How to use the echarts.getInstanceByDom function in echarts

To help you get started, we’ve selected a few echarts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sshwsfc / xadmin / xadmin-dashboard / src / widgets / EChart.js View on Github external
getEchartsInstance() {
    // return the echart object
    return echarts.getInstanceByDom(this.refs.echartsDom) || echarts.init(this.refs.echartsDom, this.props.theme)
  }
github leungwensen / d2recharts / lib / chart / recharts.js View on Github external
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);
  }
github hunnble / QandAs / client / components / Chart.jsx View on Github external
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() {
github sshwsfc / xadmin / xadmin-dashboard / src / widgets / EChartBase.js View on Github external
getEchartsInstance = () => {
    if(_.isNil(this.refs.echartsDom)) {
      return null
    }
    return echarts.getInstanceByDom(this.refs.echartsDom) || echarts.init(this.refs.echartsDom, this.props.theme)
  }
github opennode / waldur-homeport / app / scripts / components / resource / support / ResourcesTreemap.tsx View on Github external
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);
  }