Jack Hunter

Feeding Real Time Data By Javascript Method Feeddata()

Recommended Posts

I can't feed real time data on chart bay using the javascript method feedData(). The example shown in docmentation doesn't work. The method feedData() isn't recognized. There is not any running example on docs. Do someone has used this feature? Please, tell me how to.

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

The Real Time data feeding to the chart using FusionCharts JavaScript API is working fine from our end.

 

Please have a look to the attached sample.

 

In this example the HTML button Click will call the JavaScript function where, random data is generated and fed to the chart.

 

Hope this helps!

RealTime Chart Using JS API.zip

Share this post


Link to post
Share on other sites

I can't feed real time data on chart bay using the javascript method feedData(). The example shown in docmentation doesn't work. The method feedData() isn't recognized. There is not any running example on docs. Do someone has used this feature? Please, tell me how to.

 

Hey... did you check whether the chart has completely rendered before calling feedData? feedData should ideally be called after the chart's "rendererd" event is fired.

Share this post


Link to post
Share on other sites

Hi,

 

The Real Time data feeding to the chart using FusionCharts JavaScript API is working fine from our end.

 

Please have a look to the attached sample.

 

In this example the HTML button Click will call the JavaScript function where, random data is generated and fed to the chart.

 

Hope this helps!

 

Hi, Sashibhusan... I'm very tanks for your help.I had tested this sample application, but it didn't worked here. The chart rendered successfully, however the method doesn't work. I'm debugging with firebug tool and it shows a message error like "chartRef.feedData is not a function". It's being curious... It must be a detail I'm not finding out. I've tested on mozila and IE navigators. So, let's see what I can do. If you discover something, please tell me. Thanks a lot.

Share this post


Link to post
Share on other sites

Hey... did you check whether the chart has completely rendered before calling feedData? feedData should ideally be called after the chart's "rendererd" event is fired.

 

Hi, shamasis... Yeah, the chart rendered successfully, but the method doesn't work. And yeah, I'm calling the method after the chart has been rendered.However, I'm tanks for your help.

Share this post


Link to post
Share on other sites

Hi, shamasis... Yeah, the chart rendered successfully, but the method doesn't work. And yeah, I'm calling the method after the chart has been rendered.However, I'm tanks for your help.

 

Hey... one more basic check: If you are using Flash renderer, did you try ensuring that you have correct Flash Global Security Settings? Try: http://goto.fusioncharts.com/flash-global-security-settings-guide

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

Could you please check if the chart has rendered successfully or not, before updating the data by using JavaScript function "feedData();"?

 

Please change the code as per the reference code provided below:

function feedDataToChart(){
var chartRef = FusionCharts("myChartId");
var currDate = new Date();
var label= currDate.getHours() + ":" + currDate.getMinutes() + ":" + currDate.getSeconds();
var randomValue = Math.floor(Math.random()*500)/100 + 30;
var strData = "&label=" + label + "&value=" + randomValue;
function FC_Rendered("myChartId"){
   	chartRef.feedData(strData);                     	
   	}
else{
   	alert("The Chart has not rendered. Unable to feed data.");
   	}
return;
}

 

Hope this helps!

Share this post


Link to post
Share on other sites
Guest Sashibhusan

Hi,

 

I am glad to hear that your issue has been resolved.:D

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now