Jamessteelforth

Trouble In Using Setdataxml

Recommended Posts

I am using the same sample code given for bullet graphs and instaed of taking data values from a file in data folder i am trying to set the data on the HTML page itself.

 

 

<div align="center">

<script type="text/javascript">

var myChart = new FusionCharts("Charts/VBullet.swf", "myChart4", "80", "270", "0", "0");

 

myChart.setDataURL("Data/WageIncrease.xml");

 

myChart.render("chartdiv4");

</script>

</div>

 

 

REPLACED WITH

 

 

</div><div align="center">

<script type="javascript">

var myChart = new FusionCharts("Charts/VBullet.swf", "myChart4", "80", "270", "0", "0");

myChart.setDataXML("<chart>

<value>13</value>

<target>74</target>

</chart>");

myChart.render("chartdiv4");

</script>

 

But this is not working what am i doing wrong????

Share this post


Link to post
Share on other sites

Hi,

 

I am using the same sample code given for bullet graphs and instaed of taking data values from a file in data folder i am trying to set the data on the HTML page itself.

<div align="center">

<script type="text/javascript">

var myChart = new FusionCharts("Charts/VBullet.swf", "myChart4", "80", "270", "0", "0");

 

myChart.setDataURL("Data/WageIncrease.xml");

 

myChart.render("chartdiv4");

</script>

</div>

 

REPLACED WITH

</div><div align="center">

<script type="javascript">

var myChart = new FusionCharts("Charts/VBullet.swf", "myChart4", "80", "270", "0", "0");

myChart.setDataXML("<chart>

<value>13</value>

<target>74</target>

</chart>");

myChart.render("chartdiv4");

</script>

 

But this is not working what am i doing wrong????

 

Could you please remove the new line characters while providing the XML in datastring method and see if this helps?

Ex:

[/size]
[size=2]</div><div align="center">[/size]                             	<script type="javascript">
	        	var myChart = new FusionCharts("Charts/VBullet.swf", "myChart4", "80", "270", "0", "0");
	        	myChart.setDataXML("<chart><value>13</value><target>74</target></chart>");
	        	myChart.render("chartdiv4");
	    	</script>

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

I did as you told i wrote in the same line as below and it didnt work!!!!

 

<div align="center">[/size] <script type="javascript">

var myChart = new FusionCharts("Charts/VBullet.swf", "myChart4", "80", "270", "0", "0");

myChart.setDataXML("<chart><value>13</value><target>74</target></chart>");

myChart.render("chartdiv4");

</script>[/code]

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