Sign in to follow this  
ganiganesh

Setjsondata Is Not Working

Recommended Posts

Hi Team,

 

i am using the below code to get the chart using setJSONData method but getting script error "object doesnot support this property or method". i got that it is problem with fusioncharts.js file as there is no such method.

i have followed your suggestion provided in similar topic Please download the latest FusionCharts i.e v 3.2.1 from : http://www.fusioncharts.com/download/

but i am unable to find setJSONData method in downloaded fusioncharts.js as well.i also checked for this method in FC3.2.2 js file but no such method.

 

can you please provide me the solution?

 

 

 

 

<script type="text/javascript">

var chart = new FusionCharts("../content/charts/MultiAxisLine.swf", "ChartId", "740", "231", "0", "0");

chart.setJSONData('{ "chart": { "caption": "Sample", "showborder": "0", "linethickness": "1", "bgcolor": "#FFFFFF", "showvalues": "0", "formatnumberscale": "0", "labeldisplay": "ROTATE", "slantlabels": "1", "rotatevalues": "1", "divlinecolor": "#FFFFFF", "borderthickness": "0", "alternatehgridcolor": "FCB541", "alternatehgridalpha": "20", "divlinealpha": "50", "canvasbordercolor": "666666", "basefontcolor": "3E3E3F" } }');

chart.render("chartdiv");

</script>

 

Share this post


Link to post
Share on other sites
Guest Sumedh

Hi Team,

 

i am using the below code to get the chart using setJSONData method but getting script error "object doesnot support this property or method". i got that it is problem with fusioncharts.js file as there is no such method.

i have followed your suggestion provided in similar topic Please download the latest FusionCharts i.e v 3.2.1 from : http://www.fusioncharts.com/download/

but i am unable to find setJSONData method in downloaded fusioncharts.js as well.i also checked for this method in FC3.2.2 js file but no such method.

 

can you please provide me the solution?

 

 

 

 

<script type="text/javascript">

var chart = new FusionCharts("../content/charts/MultiAxisLine.swf", "ChartId", "740", "231", "0", "0");

chart.setJSONData('{ "chart": { "caption": "Sample", "showborder": "0", "linethickness": "1", "bgcolor": "#FFFFFF", "showvalues": "0", "formatnumberscale": "0", "labeldisplay": "ROTATE", "slantlabels": "1", "rotatevalues": "1", "divlinecolor": "#FFFFFF", "borderthickness": "0", "alternatehgridcolor": "FCB541", "alternatehgridalpha": "20", "divlinealpha": "50", "canvasbordercolor": "666666", "basefontcolor": "3E3E3F" } }');

chart.render("chartdiv");

</script>

 

 

Hi,

 

Try by removing the single quotes in the setJSONData function.

 

chart.setJSONData('{ "chart" ... }');

Modify this to: chart.setJSONData({ "chart" ... } });

Share this post


Link to post
Share on other sites

its working fine now after copying fusioncharts.js,FusionCharts-HC.js ,FusionCharts-HC-Chart.js ,jquery-min.js from charts folder as you suggested in documentation.

 

my doubt is that

 

1)can we use same FusionCharts.js,jquery-min.js,Fusion-HC.js file for fusion charts and power charts? because we have FusionCharts-HC-Chart.js for fusion chart and FusionCharts-HC-PowerChart.js for power charts.

 

2) do i have to use same js files for XML or JSON methods?

 

 

 

Hi,

 

Try by removing the single quotes in the setJSONData function.

 

chart.setJSONData('{ "chart" ... }');

Modify this to: chart.setJSONData({ "chart" ... } });

Edited by ganiganesh

Share this post


Link to post
Share on other sites
Guest Sumedh

its working fine now after copying fusioncharts.js,FusionCharts-HC.js ,FusionCharts-HC-Chart.js ,jquery-min.js from charts folder as you suggested in documentation.

 

my doubt is that

 

1)can we use same FusionCharts.js,jquery-min.js,Fusion-HC.js file for fusion charts and power charts? because we have FusionCharts-HC-Chart.js for fusion chart and FusionCharts-HC-PowerChart.js for power charts.

 

2) do i have to use same js files for XML or JSON methods?

 

 

 

 

 

Hi,

 

Please find answers to your queries inline below:

 

1)can we use same FusionCharts.js,jquery-min.js,Fusion-HC.js file for fusion charts and power charts? because we have FusionCharts-HC-Chart.js for fusion chart and FusionCharts-HC-PowerChart.js for power charts.

 

> Please refer the following URL and read 2nd section (I have upgraded to FusionCharts XT and now my existing JavaScript charts of PowerCharts and FusionWidgets pack are not working) :

http://docs.fusionch...g/Advanced.html

 

2) do i have to use same js files for XML or JSON methods?

> Using same JS files you can use all the XML and JSON Methods.

 

Refer the following URL for more information:

http://docs.fusionch...I/Overview.html

Share this post


Link to post
Share on other sites

Thanks for your links.

 

i am using fusion charts and power charts in my application so the following js files need to be used

 

1)FusionCharts.js

2)jquery-min.js

3)Fusion-HC.js

4)FusionCharts-HC-Chart.js (FusionCharts)

5)FusionCharts-HC-PowerChart.js(Power Charts)

 

i dont worry about the 4 and 5 because unique files for fusion and power charts which i will copy from respective Charts folders.

 

Q1) Files 1,2 and 3 should be copied from which charts folder as they are having different sizes in FusionCharts XT --> Charts and PowerCharts --> Charts

Q2)After upgrading to FusionCharts XT can i use the old version swf files for fusion/power charts?

 

Q3) i am not getting power chart (multiaxisline chart) in MAC os which is working fine in other OS.no extra spaces,double quotes,duplicate attributes in XML but its showing invalid data. can you please provide me the solution?

 

Hi,

 

Please find answers to your queries inline below:

 

1)can we use same FusionCharts.js,jquery-min.js,Fusion-HC.js file for fusion charts and power charts? because we have FusionCharts-HC-Chart.js for fusion chart and FusionCharts-HC-PowerChart.js for power charts.

 

> Please refer the following URL and read 2nd section (I have upgraded to FusionCharts XT and now my existing JavaScript charts of PowerCharts and FusionWidgets pack are not working) :

http://docs.fusionch...g/Advanced.html

 

2) do i have to use same js files for XML or JSON methods?

> Using same JS files you can use all the XML and JSON Methods.

 

Refer the following URL for more information:

http://docs.fusionch...I/Overview.html

Share this post


Link to post
Share on other sites
Guest Sumedh

Thanks for your links.

 

i am using fusion charts and power charts in my application so the following js files need to be used

 

1)FusionCharts.js

2)jquery-min.js

3)Fusion-HC.js

4)FusionCharts-HC-Chart.js (FusionCharts)

5)FusionCharts-HC-PowerChart.js(Power Charts)

 

i dont worry about the 4 and 5 because unique files for fusion and power charts which i will copy from respective Charts folders.

 

Q1) Files 1,2 and 3 should be copied from which charts folder as they are having different sizes in FusionCharts XT --> Charts and PowerCharts --> Charts

Q2)After upgrading to FusionCharts XT can i use the old version swf files for fusion/power charts?

 

Q3) i am not getting power chart (multiaxisline chart) in MAC os which is working fine in other OS.no extra spaces,double quotes,duplicate attributes in XML but its showing invalid data. can you please provide me the solution?

 

 

 

 

 

Hi,

 

Find answers to your queries in-line below:

 

Q1) Files 1,2 and 3 should be copied from which charts folder as they are having different sizes in FusionCharts XT --> Charts and PowerCharts --> Charts

>> If you want to render Charts from FusionChats and PowerCharts pack, you would need to copy all FusionCharts library files and PowerCharts related JS library files into your project folder.

There is no difference in FusionCharts.js from PowerCharts pack and FusionCharts pack. These library files are classified for individual charting pack. (for convenient use)

 

Q2)After upgrading to FusionCharts XT can i use the old version swf files for fusion/power charts?

>> If you want to implement all new feature of newer version, then it is recommended to use new SWF files as well. (for proper results)

 

Q3) i am not getting power chart (multiaxisline chart) in MAC os which is working fine in other OS.no extra spaces,double quotes,duplicate attributes in XML but its showing invalid data. can you please provide me the solution?

>> Please check if the XML data is properly formatted or not? and also check if you have properly specified the relevant chart SWF file in the FusionCharts constructor?

 

For more information, please refer the following URL:

http://docs.fusionch...ebug/Basic.html

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