api文档:https://github.com/ecomfe/echarts-liquidfill#api
LiquidfillChart组件代码:
import React, { PureComponent } from 'react';
import echarts from 'echarts/lib/echarts';
import 'echarts-liquidfill';
import styles from './index.less';
class LiquidfillChart extends PureComponent {
constructor(props) {
super(props);
this.state = {};
}
componentDidMount() {
const { data } = this.props;
this.initLiquidfillChart(data);
// 窗口改变重新加装定时器并重绘echarts
window.addEventListener('resize