Skip to content

Commit d1bc045

Browse files
committed
update
1 parent 4265d33 commit d1bc045

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,24 @@ $ npm install rc-echarts
88

99
###用法一
1010

11-
完全和echarts一致,将echarts的options传给组件。
11+
完全和echarts一致,将echarts的options传给组件。通过onReady能获取到echarts对象,从而进行绑定事件等一系列操作。
1212

1313
```js
1414
import Chart from 'rc-echart';
1515
import React from 'react';
1616
import ReactDOM from 'react-dom';
1717

1818
const myChart = React.creatClass({
19+
ready(echart) {
20+
console.log(echart);
21+
echart.on('click', (params)=>{
22+
console.log(params);
23+
alert("click");
24+
});
25+
}
26+
1927
render() {
20-
<Chart options={ options } />
28+
<Chart options={ options } onReady={this.ready} />
2129
}
2230
})
2331
ReactDOM.render(<myChart />, container);

0 commit comments

Comments
 (0)