Sign in to follow this  
Steve Osborn

Why can I resize width but not height

Recommended Posts

Hello.

 

I am trying to make my pie chart resize to the space available in the browser.  I can get it to shrink with the changing width but if I do not make the height a fixed size it will not display the chart at all.  See below:

 

<script src="../FusionChartsXT/FusionCharts.js" language="JavaScript"></script>
<br></br>

<center>

    <div id="iSlsCrdDiv" style="width:100%; height:100%;">The Sales & Credit Percentage chart will appear here. </div>
    <script type="text/javascript">

        <!--
             var iSlsCrdObj = new FusionCharts("/FusionChartsXT/Pie3D.swf",
             "iSlsCrd",
             "100%",
             "400",
             "0",
             "1");
            iSlsCrdObj.setXMLData("<chart caption='Sales & Credit Percentages for MAR' startingAngle='270' xAxisName='' yAxisName='' showLegend='0' showValues='1' showPercentValues='1' showPercentInToolTip='0' zeroPlaneColor='EEEEEE' zeroPlaneAlpha='100' zeroPlaneBorderColor='5F5F5F' numberPrefix='$' decimals='2' formatNumberScale='0' decimalSeparator='.' formatNumber='1' thousandSeparator=',' baseFontColor='8B0000' baseFontSize='12' baseFont='Arial' canvasBgDepth='20' canvasBaseColor='FEFEFE' chartLeftMargin='2' chartRightMargin='2' enableSmartLabels='1' manageLabelOverflow='1' bgAlpha='100' bgColor='FFFFFF'><set label='Qwik-Order Sales' color='00CCFF' value='249339.21'/><set label='Manual Sales' color='FFCC00' value='997600.53'/><set label='Credits' color='990033' value='21310.66'/></chart>");
            iSlsCrdObj.render("iSlsCrdDiv");
            //-->
     </script>

</center>
 

 

Thank you for your time.

Share this post


Link to post
Share on other sites
Guest Rishab

Hi,

Please provide us FusionCharts XT suite version used.

At our end, the chart is rendering fine in the above mentioned scenario using the latest version of FusionCharts.

As a suggestion, please try once setting absolute height to the parent container and check.

Share this post


Link to post
Share on other sites

It is version 3.3.1.

 

I tried setting the fixed height in the parent container and it does the same as the above code.  It renders and resizes when I change the width of the browser window, but changing the height of the browser window has no impact on resizing the chart.  Thanks.

Share this post


Link to post
Share on other sites

I set up your code and it worked fine.  However, when I replaced your <HTML> and <BODY> tags with our customary header information, the cart would not load.  I narrowed it down to the following line which I removed and the chart loaded and resized in both directions.

 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

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