| 12345678910111213141516171819202122232425 |
- import React from 'react'
- import Echarts from 'echarts-for-react'
- import { connect } from 'dva'
- import { hashcode } from '../../../utils/baseUtils'
- import EmptyContent from '../../common/emptyContent'
- const EchartsView = ({ chartDesigner }) => {
- const { chartOption } = chartDesigner;
- if(!chartOption.series) {
- return <EmptyContent />
- }else {
- return <Echarts
- key={hashcode(chartOption)}
- option={chartOption}
- className='rc-echarts'
- style={{height: '100%'}}
- />
- }
- }
- function mapStateToProps({ present: { chartDesigner } }) {
- return { chartDesigner: chartDesigner }
- }
- export default connect(mapStateToProps)(EchartsView);
|