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

App freezes when using SFChart in ListView

I'm having issues where SFChart is causing my app to freeze when using it in a Xamarin Forms ListView. Just to make sure this wasn't something particular about my app, I tried this in your own sample app as well and experienced a different issue where the app crashes instead.

Any ideas?

The following XAML will cause the app to freeze (modified from your sample app):

<ListView x:Name="ListView" HasUnevenRows="True">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<chart:SfChart HeightRequest="200">

<chart:SfChart.PrimaryAxis>
<chart:CategoryAxis LabelPlacement ="BetweenTicks" />
</chart:SfChart.PrimaryAxis>

<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis EdgeLabelsDrawingMode="Shift" />
</chart:SfChart.SecondaryAxis>

<chart:SfChart.Series>
<chart:BarSeries ItemsSource="{Binding LineData}" XBindingPath="Name" YBindingPath="Value">
<chart:BarSeries.DataMarker>
<chart:ChartDataMarker />
</chart:BarSeries.DataMarker>
</chart:BarSeries>
</chart:SfChart.Series>

</chart:SfChart>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>

With the following in the code behind:

public partial class Bar
{
public Bar ()
{
InitializeComponent ();

this.ListView.ItemsSource = Enumerable.Range (0, 20).Select (x => new ViewModel ());
}
}

3 Replies

ME Manivannan Elangovan Syncfusion Team July 20, 2015 11:28 AM UTC

Hi Michael,


Sorry about the inconvenience caused.


We have analyzed the reported issue "App crashes when using the Chart inside the ListView in iOS" and we are able to reproduce the issue. We have logged a defect report for the issue and the fix for the issue is estimated to be available in our Service Pack release, which is scheduled to roll out by the end of this month.


Please let us know if you have any other queries.


Thanks,
Manivannan.E



XZ xu zhi bin July 22, 2015 02:17 AM UTC

Can you answer my question?


ME Manivannan Elangovan Syncfusion Team July 22, 2015 12:35 PM UTC

Hi Xu,


Sorry about the inconvenience caused.


We have created a workaround sample to resolve the issue by using CustomRenderer. CustomRenderer is used to represent the SfChart for our own and it need CustomChart to render the chart.


Please download the sample from below location.


Sample: ListViewChart


We have already logged a defect report for the issue "App crashes when using the Chart inside the ListView in iOS" and the fix for the issue is estimated to be available in our Volume 2 Service Pack 1 release, which is scheduled to roll out by the end of this month.


Thanks,
Manivannan.E


Loader.
Up arrow icon