|
|
@@ -1,5 +1,5 @@
|
|
|
import React, { Component } from 'react';
|
|
|
-import {isEqual} from '../../utils/BaseUtils.js';
|
|
|
+import {isEqual, hashcode} from '../../utils/BaseUtils.js';
|
|
|
import ReactEcharts from 'echarts-for-react';
|
|
|
import reset from './ResetCharts.js';
|
|
|
import {dark} from './Theme/Theme.js';
|
|
|
@@ -63,9 +63,17 @@ export class ReactEchart extends React.Component {
|
|
|
this.reset();
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 通过配置项option内容创建key
|
|
|
+ */
|
|
|
+ createKey(option) {
|
|
|
+ return hashcode(option);
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
+ let key = this.createKey(this.state.option);
|
|
|
return (
|
|
|
- <ReactEcharts ref={(e) => { this.echarts_react = e; }}
|
|
|
+ <ReactEcharts key={key} ref={(e) => { this.echarts_react = e; }}
|
|
|
option={this.state.option}
|
|
|
style={{height: '100%', width: '100%'}}
|
|
|
className='rc-echarts'
|