Sign in to follow this  
doggerdude

getChartFromId and setDataXML not found error

Recommended Posts

When I get my chart using getChartFromId in the chart rendered event, and try to load some new data, I get the setDataXML not found error. I'm using firefox and mixing with seam and extjs. Ive searched the forums and google but have had no luck... We are looking to purchase a license very soon but need to get this working first...

 

 

 

The chart will appear within this DIV. This text will be replaced by the chart.

 

 

 

function FC_Rendered(DOMId){

 

var myChart= getChartFromId("chart1id");

 

myChart.setDataXML(chartXml);

 

return true;

 

}

 

 

 

var callback1 = function(chartXml) {

 

var chart1 = new FusionCharts("#{contextPath}/fusioncharts/templates/Column3D.swf", "chart1id", "450", "300", "0", "1");

 

chart1.setDataXML(chartXml);

 

chart1.render("chart1div");

 

};

 

Seam.Component.getInstance('dashboard').getOpportunitiesByCustomerType(callback1);

Share this post


Link to post
Share on other sites

Thanks for the suggestion... I tried it but still get this error:

 

 

 

chart1.setDataXML is not a function

 

 

 


The chart will appear within this DIV. This text will be replaced by the chart.    



    	function FC_Rendered(DOMId){

    		firebugLog(DOMId + ' has rendered.');



    		if (DOMId=="chart1id")

    		{		    		

		    	var callback4 = function(chartXml) {

		       		firebugLog('chart 1 data:'+chartXml);

		       		var chart1 = document.getElementById("chart1id");

			    	chart1.setDataXML(chartXml);

			    	chart1.render("chart1div");

			    	firebugLog('chart1id render request.');

				};

				var exceptionHandler1 = function(ex) { alert("An exception occurred: " + ex.getMessage()); };

				Seam.Component.getInstance('dashboard').getOpportunitiesByCustomerType(callback4);

    		}



			return true;

	    }



      		var chart1 = new FusionCharts("#{contextPath}/fusioncharts/templates/Column3D.swf", "chart1id", "450", "300", "0", "1");

    	chart1.setDataXML("");

    	chart1.render("chart1div");

Share this post


Link to post
Share on other sites

I finally figured it out... Was related to how I was adding the chart within an extjs panel...

 

 

 

I was adding the chart this way:

 

 

 

html: document.getElementById('chart2div').innerHTML

 

 

 

but once I changed it to this, everything was fine!

 

 

 

contentEl: 'chart2div'

 

 

 

Just a little thing to watch out for if you are using extjs!

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
Sign in to follow this