dsnarus

Percent Width/height Charts Not Working

Recommended Posts

Hello,

 

Thanks for your support on my previous issue. A new one has arisen! The render_chart method does not work for me when I try to use percent chart width and height. Ex:

 

<div id=superTestChart>Super Test Chart will load here!</div>

<% str_xml = render :file=>"overallstats/sampledata" %>

<% render_chart '/Fusioncharts/MSLine.swf', '', str_xml, 'sampleChartSuper', '100%', '50%', 'superTestChart', false, false %>

 

produces something like:

 

<!-- START Script Block for Chart sampleChartSuper --> <script type='text/javascript'> var chart_sampleChartSuper=new FusionCharts({"swfUrl":"/Fusioncharts/MSLine.swf","id":"sampleChartSuper","width":"100%","height":"50%","debugMode":"0","registerWithJS":"0","dataSource":"LOTS OF XML HERE, SNIPPED FOR BREVITY","dataFormat":"xml","detectFlashVersion":"0","autoInstallRedirect":"0","renderAt":"superTestChart"}).render(); </script> <!-- END Script Block for Chart sampleChartSuper -->

 

This will not load any data. Any suggestions?

 

Share this post


Link to post
Share on other sites

Hi

 

Please ensure that the chart container has a width and height specified.

 

Fr example, in your code, you would have the div defined as follows:

 

<div id="superTestChart" style="height:400px;width:400px;">FusionCharts will load here</div>

 

If the chart itself is not loading, then it must have something to do with the data. Please post the screen-shot of the error and debug window.

 

Hope this helps. :)

Srividya Sharma

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