setDataURL() example in docs not working
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


123»»»

setDataURL() example in docs not working Expand / Collapse
Author
Message
Posted 7/18/2007 10:35:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 7/18/2007 2:15:21 PM
Posts: 1, Visits: 4
For the docs that come with the demo version of FusionCharts, there's the "setDataURL()" example under the"FusionCharts and Javascript" folder. This demo explains the file Download Package > Code > JavaScript > Basics. However, when I try to run this file in my browser (ChangeDataURL()), it gives me the error "chartObj.setDataURL is not a function." I've tried it both in Firefox and IE with the same result. Is this feature disabled in the demo? Why is the help file example throwing an error?
Post #1675
Posted 7/20/2007 2:16:30 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/2/2008 7:57:52 PM
Posts: 1,956, Visits: 468
Just copy-paste the files to a server and run (either localhost or remote).

Thanks,
Pallav Nadhani
FusionCharts Team
Post #1690
Posted 8/28/2007 12:27:54 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/20/2007 11:54:25 PM
Posts: 6, Visits: 13
I tried to run it from the server. Yet getting the same javascript error mentioned earlier. "chartObj.setDataURL is not a function".

Lavanya Sriram
Post #2117
Posted 8/28/2007 12:48:17 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/20/2007 11:54:25 PM
Posts: 6, Visits: 13
The chartObj object is a HTMLEmbedElement object and not a FusionChart Object. This explains why the setDataURL/setDataXML gives an error when invoked on this object. But can you tell us how to go about resolving this?

Lavanya Sriram
Post #2118
Posted 8/28/2007 1:05:52 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/20/2007 11:54:25 PM
Posts: 6, Visits: 13
Here's how we go about it. In FusionCharts.js replace chartObj.setDataXML(strDataXML); with this.addVariable("dataURL",strDataXML). That works!!

Lavanya Sriram
Post #2119
Posted 8/31/2007 10:54:53 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 8/31/2007 11:43:30 AM
Posts: 5, Visits: 8
Any chance of getting an actual answer from InfoSoft? What exactly do I have to do to my JS to get this dynamic update to work???

Please don't tell me to run it on the server, I have already tried.

Here is the error I am getting: chartObj.setDataURL is not a function

A real answer would be great!!!
Post #2201
Posted 9/2/2007 2:58:12 AM
FusionCharts Team

FusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts TeamFusionCharts Team

Group: Administrators
Last Login: 7/2/2008 7:57:52 PM
Posts: 1,956, Visits: 468
If you're getting an error that setDataURL/setDataXML is not a function of the chart object, please make sure of the following:

1. Please make sure that you're using FusionCharts v3 charts, as the JavaScript API was introduced in this version. To check whether you're using v3, just match your SWF name with the names listed at http://www.fusioncharts.com/Docs/Contents/ChartList.html

2. Please ensure that you've set registerWithJS flag to 1. For more information on how to do this, please see http://www.fusioncharts.com/Docs/Contents/JS_Overview.html. Basically, you need to set the last parameter in the following code to 1:
var chart1 = new FusionCharts("FusionCharts/Column3D.swf", "chart1Id", "400", "300", "0", "1");

3. Please make sure that you're not placing the chart inside a FORM element. When the chart is inside a FORM element, the browser cannot access the chart using DOM.

4. Please make sure that you're not calling the setDataURL/setDataXML method before the chart has loaded and rendered. You need to use FC_Rendered function of chart to track the loading of chart as explained at http://www.fusioncharts.com/Docs/Contents/JS_Overview.html. The page's body onLoad event would NOT work, as the chart starts loading after the body has finished loading.

5. Please make sure that you're NOT running the chart from local file system (C:\ , D:\). Instead, run the chart from behind a server (localhost - IIS, Apache etc.). This is because the Flash Player security settings do not allow Chart to JavaScript interaction, unless otherwise specifically set.

Thanks,
Pallav Nadhani
FusionCharts Team

Post #2206
Posted 9/7/2007 11:05:57 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 9/13/2007 4:24:47 PM
Posts: 3, Visits: 4
I have having similar issues. I am using the code exactly as given in the examples. They all work perfectly fine in Firefox and Safari but do not work in IE. The problem is with the getChartFromId function. In Firefox that function returns another function which the setDataURL function works on. However, in IE the getChartFromId is returning an object which doesn't support the function setDataURL. I have gone through the checklist above and doubled checked that it is being registered with JS (I even used the FC_Rendered function to verify this) and that the chart is not in a form tag. When is curious is that it works in all the browsers except IE. I am using the Prototype JS library in my app. Are there known issues with Prototype interfering with your JS libraries in IE? If you have any further suggestions on how I might resolve this issue please let me know. Thanks,

Ben
Post #2284