|
|
@@ -2,27 +2,16 @@ import React from 'react'
|
|
|
import Echarts from '../../common/echarts/index'
|
|
|
import { hashcode } from '../../../utils/baseUtils'
|
|
|
import EmptyContent from '../../common/emptyContent'
|
|
|
-import Thumbnail from '../../common/echarts/thumbnail'
|
|
|
|
|
|
const EchartsView = ({ chartOption }) => {
|
|
|
- let children;
|
|
|
if(!chartOption || ((!chartOption.series || chartOption.series.length === 0) && (!chartOption.baseOption || !chartOption.baseOption.series || chartOption.baseOption.series.length === 0))) {
|
|
|
- children = <EmptyContent />
|
|
|
+ return <EmptyContent />
|
|
|
}else {
|
|
|
- children = <Echarts
|
|
|
+ return <Echarts
|
|
|
key={hashcode(chartOption)}
|
|
|
option={chartOption}
|
|
|
/>
|
|
|
}
|
|
|
- return <div style={{ background: '#fff', width: '100%', height: '100%' }}>
|
|
|
- {/* 创建一个隐藏echarts容器用于截缩略图 */}
|
|
|
- <Thumbnail
|
|
|
- style={{ position: 'absolute', display: 'none', top: 0, left: 0 }}
|
|
|
- key={`thumbnail-${hashcode(chartOption)}`}
|
|
|
- option={chartOption}
|
|
|
- />
|
|
|
- {children}
|
|
|
- </div>
|
|
|
}
|
|
|
|
|
|
export default EchartsView;
|