echartsView.jsx 545 B

1234567891011121314151617181920212223242526
  1. import React from 'react';
  2. import Echarts from 'echarts-for-react';
  3. class EchartsView extends React.Component {
  4. constructor(props) {
  5. super(props);
  6. this.state = {
  7. option: props.option
  8. }
  9. }
  10. componentDidMount() {
  11. }
  12. render() {
  13. return (
  14. <Echarts ref={(e) => { this.echarts_react = e; }}
  15. option={this.state.option}
  16. className='rc-echarts'
  17. style={{height: '100%'}}
  18. />
  19. )
  20. }
  21. }
  22. export default EchartsView;