InfoStrata

Javascript Mode And Sharepoint 2010

Recommended Posts

Hi,

 

I am trying to use JavaScript mode for fusion web parts in Content Editor Web Part and Custom Web Part inside SharePoint 2010. I have copied the following files in SiteAssets library:

  • FusionCharts.js
  • Column3D.swf
  • Pie3D.swf

I have enabled Web Application permissions to Permissive so that SWF files are opened properly.

 

Inside Content Editor Web Part, I have written the following code:

 

 

<div id="chartContainer"></div>

<script type="text/javascript">

<!--
     FusionCharts.setCurrentRenderer('javascript');

     var myChart = new FusionCharts( "../SiteAssets/FusionCharts/Column3D.swf", 

                   "myChartId", "400", "300", "0", "1" );

myChart.setXMLData("<chart caption='Weekly Sales Summary' xAxisName='Week' " +

       "yAxisName='Sales' numberPrefix='>" +

         "<set label='Week 1' value='14400' />" +

         "<set label='Week 2' value='19600' />" +

         "<set label='Week 3' value='24000' />" +

         "<set label='Week 4' value='15700' />" +

       "</chart>");

     myChart.render("chartContainer");      

   // -->  
   </script>

 

 

If I comment out the line " FusionCharts.setCurrentRenderer('javascript'); " , the chart renders properly, as it uses the SWF file. Whereas, if I try to use javascript mode, it displays "Loading Chart. Please Wait" continuously, as attached in jpeg file.

 

Please let me know how can I use Java Script enabled fusion charts inside custom web part / Content Query Web Part.

 

Thanks.

post-27939-0-66669300-1334053852_thumb.jpg

Share this post


Link to post
Share on other sites

Hi Ahmed,

 

Could you please confirm if you have kept the 4 files, namely, FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js in the same folder as FusionCharts.js while rendering the JavaScript charts?

 

Please note that it is very important that you keep these files in the same folder as FusionCharts.js. You do not need to load these files explicitly in HTML. FusionCharts.js automatically takes care of the loading.

Ref.- http://docs.fusioncharts.com/charts/contents/?FirstChart/UsingPureJS.html

 

Also, in case the issues still persists, please send us a Live URL so that we might be able to test it?

 

I hope this helps. Looking forward to your valuable feedback.

Share this post


Link to post
Share on other sites

Yes, I was missing those files in the SiteAssets library. Thank you, it works fine now.

 

 

Hi Ahmed,

 

Could you please confirm if you have kept the 4 files, namely, FusionCharts.HC.js, FusionCharts.HC.Charts.js and jquery.min.js in the same folder as FusionCharts.js while rendering the JavaScript charts?

 

Please note that it is very important that you keep these files in the same folder as FusionCharts.js. You do not need to load these files explicitly in HTML. FusionCharts.js automatically takes care of the loading.

Ref.- http://docs.fusionch...singPureJS.html

 

Also, in case the issues still persists, please send us a Live URL so that we might be able to test it?

 

I hope this helps. Looking forward to your valuable feedback.

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