|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117,
Visits: 498
|
|
Can you make sure that you’re: - Using v3 charts
- Set the registerWithJS flag to 1
- Not placing the chart inside a FORM element
- Not calling the setDataXML method before the chart has loaded and rendered
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/19/2007 2:16:31 PM
Posts: 8,
Visits: 14
|
|
the example works when run from a webserver. Unfortunately, I still have the problem when I try to populate with my actual web page.
I have a JBOSS server running struts. The javascript on the struts page fills data dynamically, but I always get teh cartObj has no properties when I fill it.
I have a page, that initializes the chart with blank data. I use Yahoo YUI widgets which calls the init function after the page is loaded. In the init function, it runs a dwr call to get data. when data come back, i use setDataXML to fill the chart. (Im just using a set string to populate to test). I still get chartObj has no properties.
I have something like this:
function init(){
setTimeout("Budget.getChartData(getChartDataReturn)",1500);
}
YAHOO.util.Event.addListener(window, "load", init);
function getChartDataReturn(data){
if(data != null){
var chartObj = getChartFromId("chartdiv");
chartObj.setDataXML("");
}
}
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/19/2007 2:16:31 PM
Posts: 8,
Visits: 14
|
|
Im doing all those except the
registerWithJS flag set to 1
Im following the examples you have that change XML with javacsript and I didnt see that flag being set anywhere.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/19/2007 2:16:31 PM
Posts: 8,
Visits: 14
|
|
Ive don it this way, I still get the error, this is embedded in the JSP so its not a static server error.
After init it called, the chart is rendered with No Data. When FC_Rendered is called, I get the chartObj error.
function init(){
var myChart = new FusionCharts("${staticServer}/Charts/Doughnut2D.swf", "myChartId", "900", "300", "0", "1");
myChart.setDataXML("");
myChart.render("chartdiv");
}
YAHOO.util.Event.addListener(window, "load", init);
function FC_Rendered(domId){
if (domId=="chartdiv"){
var chartObj = getChartFromId(domId);
chartObj.setDataXML("");
}
return true;
}
|
|
|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117,
Visits: 498
|
|
| The init function should be called from FC_Rendered. window.load occurs much before the chart is loaded - as the chart is a streaming SWF file. When the chart is loaded, FC_Rendered method is called - there, you need to call init().
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/19/2007 2:16:31 PM
Posts: 8,
Visits: 14
|
|
The init function is initializing the chart with blank data.
I try to put data in the chart when its loaded with the FC_Rendered function. Isnt FC_Rendered called automatically after the chart is loaded?
function init(){
var myChart = new FusionCharts("${staticServer}/Charts/Doughnut2D.swf", "myChartId", "900", "300", "0", "1");
myChart.setDataXML("");
myChart.render("chartdiv");
}
YAHOO.util.Event.addListener(window, "load", init);
function FC_Rendered(domId){
if (domId=="chartdiv"){
var chartObj = getChartFromId(domId);
chartObj.setDataXML("");
}
return true;
}
|
|
|
|
|
FusionCharts Team
      
Group: Administrators
Last Login: 10/3/2008 2:42:18 AM
Posts: 2,117,
Visits: 498
|
|
| Also, please make the following change: function FC_Rendered(domId){ if (domId=="myChartId"){ var chartObj = getChartFromId(domId); chartObj.setDataXML(""); } return true; }
Thanks, Pallav Nadhani FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/19/2007 2:16:31 PM
Posts: 8,
Visits: 14
|
|
Ah, that was my problem, that fixed it, thanks. Now I have another question 
When i call the chart through Javascript like that, how do i set:
|
|
|
| | |