Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access external variables inside events.load method and I want to access all the highchart apis outside the scope, please help #115

Open
San10694 opened this issue Dec 2, 2019 · 3 comments

Comments

@San10694
Copy link

San10694 commented Dec 2, 2019

I want to access all the high chart APIs outside the scope, I tried ref={'chart' } but didn't help, I am getting all the props via ref but not other functions

for the example, how to use below statements outside of the scope like in componentDidMount() ( ie. this.series[0] is not available outside the scope)
var series = this.series[0];
setInterval(function () {
var x = (new Date()).getTime(), // current time
y = Math.random();
series.addPoint([x, y], true, true);
}, 1000);

@dinhtrumdieu
Copy link

same issue. Any Solution ?

@San10694
Copy link
Author

San10694 commented May 21, 2020

use WebView from react-native, insert data in the webview like this
<WebView style={{ height: 200, }} ref={'highCharts'} source={{ html:<your highchart string > }} />

and for accessing functions use this

this.refs.highCharts.postMessage(JSON.stringify(data))

and for listening data use this inside your highchart string

` document.addEventListener("message", (event) => {

})
`

@dinhtrumdieu
Copy link

use WebView from react-native, insert data in the webview like this
<WebView style={{ height: 200, }} ref={'highCharts'} source={{ html:<your highchart string > }} />

and for accessing functions use this

this.refs.highCharts.postMessage(JSON.stringify(data))

and for listening data use this inside your highchart string

` document.addEventListener("message", (event) => {

})
`

It would be great if you could show an example for use series.addPoint() . I'm stuck this issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants