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

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:SfChart.PrimaryAxis>
                            <chart:NumericalAxis />
                        </chart:SfChart.PrimaryAxis>
                        <chart:SfChart.SecondaryAxis>
                            <chart:NumericalAxis />
                        </chart:SfChart.SecondaryAxis>
                        <chart:SplineAreaSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"  />
                    </chart:SfChart>

            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: 4.2.0.910310
Syncfusion: 17.3.0.29


3 Replies

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

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" > 
……. 
</chart:SfChart> 
  
  
  
And we have prepared a sample based on your requirement and you can download the sample from the below link. 
  
Samplehttps://www.syncfusion.com/downloads/support/forum/149591/ze/1495911997446848.zip                                  
Please let us know if any further assistance on this. 
  
Regards, 
Hemalatha M. 



DG Dachi Gogotchuri December 3, 2019 11:55 AM UTC

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 10:36 AM UTC

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. 
  
Android 
iOS 
 
 
  
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.  
 
Regards, 
Hemalatha M. 


Loader.
Live Chat Icon For mobile
Up arrow icon