Skip to content

Commit 4fc2bf2

Browse files
authored
Merge pull request #10 from sghosh9/support/apis
add onRender attribute in component to receive chart instance through callback in parent
2 parents 42ad78f + efe5e32 commit 4fc2bf2

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/ReactFC.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ var ReactFC = function (_React$Component) {
267267
this.chartObj = new this.FusionCharts(currentOptions);
268268
this.chartObj.render();
269269
this.oldOptions = currentOptions;
270+
271+
if (this.props.onRender && typeof this.props.onRender === 'function') {
272+
this.props.onRender(this.chartObj);
273+
}
270274
}
271275
}, {
272276
key: 'resolveChartOptions',

src/ReactFC.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ class ReactFC extends React.Component {
211211
this.chartObj = new this.FusionCharts(currentOptions);
212212
this.chartObj.render();
213213
this.oldOptions = currentOptions;
214+
215+
if (this.props.onRender && typeof this.props.onRender === 'function') {
216+
this.props.onRender(this.chartObj);
217+
}
214218
}
215219

216220
resolveChartOptions(props) {

0 commit comments

Comments
 (0)