Sign in to follow this  
solarisfire

Pie Chart Works In Chrome & Ie But Not In Firefox.

Recommended Posts

Worked this out. It's a problem with this line:

 

var myChart = new FusionCharts("http://trust.hornbill.net/wp-content/plugins/hornbill-trust/inc/Pie2D.swf", "1554794125", "100%", "100%", "0", "1");

Specifically the bit that says: "100%", "100%"

In IE + Chrome it works fine, and fills out to take up all the room that it needs.

In Firefox it takes up no space.

Set it to an actual figure, aka "433", "150" instead of the percentages and it works perfectly.

Not sure this is a bug in the way the firefox rendering engine handles the code, or the way flash renders...

Share this post


Link to post
Share on other sites

Hey,

 

While applying percent values for chart width and height instead of absolute pixel values, it tries to get the width or height from its parent container.

 

For example, if you have a container <div id="chartContainer"> and this DIV is not set with an absolute or relative height, the DIV's height will be zero. When a chart is rendered in this DIV with 100% height, the chart will try to derive the height of the parent DIV which is zero. The chart will render zero pixel as height.

 

<div id="chartContainer" style="width:100%; [b]height:800px;[/b]">FusionCharts will load here!</div>
<script type="text/javascript">
   var chart = new FusionCharts("Column2D.swf", "ChartId", "100%", "100%", "0", "1"); 
   chart.setXMLUrl("Data.xml");    
   chart.render("chartdiv");         
</script>

 

Hope this helps.

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