import React from 'react'
import Echarts from 'echarts-for-react'
import { hashcode } from '../../../utils/baseUtils'
import EmptyContent from '../../common/emptyContent'

const EchartsView = ({ chartOption }) => {
    if(!chartOption || !chartOption.series) {
        return <EmptyContent />
    }else {
        console.log(chartOption);
        return <Echarts
        key={hashcode(chartOption)}
        option={chartOption}
        className='rc-echarts'
        style={{height: '100%'}}
    />
    }
}

export default EchartsView;