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

SfChart version 17.1.0.52 not working on Xamarin 4.0 in UWP

I am getting 2 different exception xamarin.forms 4.0 verson using latest SfChart version. It was working fine in previous versions

here is my implementation:

 <chart:SfChart x:Name="Chart" SelectionChanged="Chart_SelectionChanged" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"  
              >


                    <chart:SfChart.Title>

                        <chart:ChartTitle Text="{Binding ChartTitle}"/>

                    </chart:SfChart.Title>
                    <chart:SfChart.PrimaryAxis>

                        <chart:DateTimeCategoryAxis AutoScrollingDelta="7"   AutoScrollingMode="End"  >

                            <chart:DateTimeCategoryAxis.Title>

                                <chart:ChartAxisTitle Text="{resx:Translate Date}"></chart:ChartAxisTitle>

                            </chart:DateTimeCategoryAxis.Title>

                        </chart:DateTimeCategoryAxis>

                    </chart:SfChart.PrimaryAxis>

                    <chart:SfChart.SecondaryAxis>

                        <chart:NumericalAxis  Minimum="0" Maximum="{Binding NumericalAxisMax}" Interval="{Binding NumericalAxisInterval}" >

                            <chart:NumericalAxis.Title>

                                <chart:ChartAxisTitle Text="{Binding NumericalAxisTitle}" ></chart:ChartAxisTitle>

                            </chart:NumericalAxis.Title>

                        </chart:NumericalAxis>

                    </chart:SfChart.SecondaryAxis>

                    <chart:SfChart.Series>

                        <chart:LineSeries EnableDataPointSelection="{Binding EnableDataPointSelection}"  XBindingPath="XValue" YBindingPath="YValue" 
                                  SelectedDataPointColor="Yellow"  ItemsSource="{Binding NumericMonthStats, Mode=OneWay}"  EnableAnimation = "true"
                                  AnimationDuration="0.8" >
                            <chart:LineSeries.DataMarker>
                                <chart:ChartDataMarker/>
                            </chart:LineSeries.DataMarker>
                        </chart:LineSeries>

                    </chart:SfChart.Series>
                    <chart:SfChart.ChartBehaviors>

                        <chart:ChartZoomPanBehavior x:Name="ZoomBehavior"  ZoomMode="X"/>

                    </chart:SfChart.ChartBehaviors>

                </chart:SfChart>

System.Exception: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at Syncfusion.UI.Xaml.Charts.ChartCartesianAxisPanel.ComputeSize(Size availableSize)
   at Syncfusion.UI.Xaml.Charts.ChartAxisBase2D.ComputeDesiredSize(Size size)
   at Syncfusion.UI.Xaml.Charts.ChartColumnDefinition.Measure(Size size, List`1 nearSizes, List`1 farSizes)
   at Syncfusion.UI.Xaml.Charts.ChartCartesianAxisLayoutPanel.MeasureAxis(Size ava


System.ArgumentOutOfRangeException: Value to add was out of range.
Parameter name: value
   at System.DateTime.Add(Double value, Int32 scale)
   at Syncfusion.UI.Xaml.Charts.ChartZoomPanBehavior.RaiseZoomChangingEvent(Double zoomPosition, Double zoomFactor, ChartAxisBase2D axis)
   at Syncfusion.UI.Xaml.Charts.ChartZoomPanBehavior.Zoom(Double cumulativeScale, Double origin, ChartAxisBase2D axis)
   at Syncfusion.UI.Xaml.Charts.ChartZoomPanBehavior.MouseWheelZoom(Point mousePoint, Double direction)

2 Replies

EM Emil June 22, 2019 05:13 PM UTC

I have downgraded on 17.1.0.40, everything works fine using xamarin.forms 4.0.
It seems like that you have either bug or breaking change in between versions. 


RA Rachel A Syncfusion Team June 24, 2019 10:43 AM UTC

Hi Emil, 
 
We deeply regret for the inconvenience caused.  
 
Query 1: Regarding Catastrophic failure exception. 
We have already checked and resolved this problem in our side. The fix will be included in our upcoming Volume 2 release, which is scheduled to be rolled out at the end of June 2019.  
 
To avoid the delay, you can use the below alternative solution by defining FontFamily property as shown in the below code example.  
[XAML] 
<chart:SfChart.PrimaryAxis> 
    <chart:DateTimeCategoryAxis AutoScrollingDelta="7"   AutoScrollingMode="End"  > 
        <chart:DateTimeCategoryAxis.Title> 
            <chart:ChartAxisTitle Text="{Binding AxisTitle}" FontFamily="Segoe UI"></chart:ChartAxisTitle> 
        </chart:DateTimeCategoryAxis.Title> 
    </chart:DateTimeCategoryAxis> 
</chart:SfChart.PrimaryAxis> 
<chart:SfChart.SecondaryAxis> 
    <chart:NumericalAxis  Minimum="0" Maximum="{Binding NumericalAxisMax}" Interval="{Binding NumericalAxisInterval}" > 
        <chart:NumericalAxis.Title> 
            <chart:ChartAxisTitle Text="{Binding NumericalAxisTitle}" FontFamily="Segoe UI"></chart:ChartAxisTitle> 
        </chart:NumericalAxis.Title> 
    </chart:NumericalAxis> 
</chart:SfChart.SecondaryAxis> 
 
 
Query 2: Regarding ArgumentOutOfRangeException 
We are afraid, that the issue is not reproduced. The sample we tested can be downloaded from the below location.   
  
So, can you please 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, 
Rachel.  


Loader.
Live Chat Icon For mobile
Up arrow icon