We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Xamarin Chart Size

Thread ID:

Created:

Updated:

Platform:

Replies:

118699 Apr 1,2015 09:01 AM UTC Apr 8,2015 04:46 AM UTC Xamarin.Forms 3
loading
Tags: SfChart
daniele
Asked On April 1, 2015 09:01 AM UTC

Hello Syncfusion,

We are evaluating your Chart for Xamarin.Forms, we are using version 12.4451.0.34 where from Xamarin Components page you reported a fix about the Chart not rendering inside a StackLayout : 

Fix

  • #132462 - Chart now renders with the available parent size when hosted inside a StackLayout or a ScrollViewer.
Now, it seems we are encoutering the same problem or a similar one : If we try to put the chart into a StackLayout as a child nothing it's rendered, we tried to set the size of the Chart but didn't work (the space is taken but nothing is shown), only If we set it as Content of the page then it will be rendered, but at full page size. Can we set the size of the chart in someway?

Thanks,
Daniele.

Magesh Kumar Krishnan [Syncfusion]
Replied On April 1, 2015 12:34 PM UTC

Hi Daniele,

Thanks for using Syncfusion products.

We would like to let you know that we have to set VerticalOptions or HorizontalOptions for Chart when you add into Vertical or Horizontal StackLayout respectively. So chart will plot in remaining space inside StackLayout.

Please refer the below code snippet.

Code snippet [C#]:

Chart.HorizontalOptions = LayoutOptions.FillAndExpand;

Chart.VerticalOptions = LayoutOptions.FillAndExpand;


We have also prepared a sample and it can downloaded from following link.

http://www.syncfusion.com/downloads/support/directtrac/137347/ChartSample_Width_Height1315186565.zip 

You can also specify the exact Width and Height for the Chart as shown in the below code snippet.

Code snippet [C#]:

Chart.HeightRequest = 300;

Chart.WidthRequest = 300;


Please let us know if you require further assistance on this.

Thanks,
Magesh Kumar K

daniele
Replied On April 7, 2015 12:28 PM UTC

Thanks, this helped us to figure it out... just to let you know... in our case if we set VerticalOptions, HeightRequest is ignored, also if we use Center or any other enum value. 

Thanks for the fast and great support! 

Daniele.

Magesh Kumar Krishnan [Syncfusion]
Replied On April 8, 2015 04:46 AM UTC

Hi Daniele,

Thanks for the update.
Please let us know if you require further assistance on this

Thanks,
Magesh Kumar K

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;