sanjshah

Chart Widths

Recommended Posts

Hi,

 

Is it possible to set the charts width to a percent rather than a pixel width, and then also update if the user resizes their browser?

 

I would like to use the charts on both the iPAD and desktop.

 

 

Thanks

Share this post


Link to post
Share on other sites
Guest Chaitra

Hello!

 

Welcome to FusionCharts Forum!

 

Yes, it is possible to set the chart size in percent.

 

You can set percent values for chart width and height instead of absolute pixel values. The chart will automatically adjust its dimension with respect to the parent container element.

 

Dynamic updating of chart size is also possible.

 

Starting v3.2, FusionCharts can dynamically resize itself when the parent container resizes. For this you would need to:

  • Set the chart's size in percentage, and
  • Set your HTML chart container such that its dimension changes dynamically when the browser resizes or changes, due to some other changes made in a web page (like when an element is added/removed).

Whenever the container element resizes, the chart will also dynamically resize itself instantly.

 

Please refer to the following link for more information.

http://docs.fusionch...ChangeSize.html

 

Also, FusionCharts JavaScript Class allows you to resize an existing chart using resizeTo() function. You can pass the new width and height of the chart in pixels or percent parameters of resizeTo() function. You can also make change width and height property of the chart object and then call resizeTo() function.

 

Ref Code:

 

var chartReference = FusionCharts( "myChartId" );

chartReference.resizeTo( "80%", "75%" );

 

Hope this helps!!

Edited by Chaitra

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