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. Image for the cookie policy date

DoughnutSeries in Android is not showing and SplineAreaSeries in iOS neither

Hi, the DoughnutSeries code: (where Data is a List<ChartDataPoint>) => works on iOS

                    <chart:SfChart x:Name="chart">
                            <chart:ChartLegend x:Name="legend" DockPosition="Bottom" OverflowMode="Wrap" ItemTemplate="{StaticResource LegendTemplate}" />
                            <chart:DoughnutSeries StartAngle="-90" EndAngle="270" StrokeWidth="4" StrokeColor="White" DoughnutCoefficient="0.4" ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue" LegendIcon="Circle">
                                    <chart:ChartDataMarker ShowLabel="True" LabelContent="Percentage"/>
                                    <chart:ChartColorModel Palette="Custom" CustomBrushes="{StaticResource Colors}"/>

And here is the SplineAreaSeries code: (where Data is a ObservableCollection<ChartDataPoint>) => not working (this is the basic example, but is not showing on the simulator)

                    <chart:SfChart x:Name="Chart">
                            <chart:NumericalAxis />
                            <chart:NumericalAxis />
                        <chart:SplineAreaSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"  />

            Data = new ObservableCollection<ChartDataPoint>();
            Data.Add(new ChartDataPoint(1, 35));
            Data.Add(new ChartDataPoint(2, 10));
            Data.Add(new ChartDataPoint(3, 8));
            Data.Add(new ChartDataPoint(4, 5));

Xamarin.Forms version:

3 Replies

HM Hemalatha Marikumar Syncfusion Team December 3, 2019 06:41 AM

Hi Dachi Gogotchuri, 
Greetings from Syncfusion. 
We have validated the reported issue and we were unable to reproduce the reported issue at our end. We suspect that chart has a parent layout of StackLayout. You can resolve this issue by setting HorizontalOptions and VerticalOptions as FillAndExpand to the chart as per the below code snippet.  Because the desired size support only works for the accumulation series. Hence for the Cartesian series, you must set Layout options as FillAndExpand or else set the size (Height and Width) for the chart. 
Code Snippet [XAML]: 
<chart:SfChart HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand" > 
And we have prepared a sample based on your requirement and you can download the sample from the below link. 
Please let us know if any further assistance on this. 
Hemalatha M. 

DG Dachi Gogotchuri December 3, 2019 06:55 AM

Hi Hemalatha Marikumar,

Yes it's into a StackLayout, but putting HorizontalOption and VerticalOption to FillAndExpanded is not working. The DoughnutSeries that was correctly rendering in the simulator, now it's not showing neither.

But an example of SplineAreaSeries into Grid it's working so the problem is the StackLayout

HM Hemalatha Marikumar Syncfusion Team December 4, 2019 05:36 AM

Hi Dachi Gogotchuri, 
Thank you for confirming the layouts used. 
We afraid that we were unable to reproduce the reported issue at our end. Please find the screenshot below for Chart inside the StackLayout. 
We have captured this with already provided sample on yesterday. Could you please provide a code snippet for chart page or revert us by modifying the sample based on your application along with replication procedure.  This will be helpful for us to investigate further and provide you a better solution at the earliest.  
Hemalatha M. 

Live Chat Icon For mobile
Up arrow icon