- Home
- Forum
- Xamarin.Forms
- Chart not able to work on my iOS simulator and device.
Chart not able to work on my iOS simulator and device.
I am using version 19.3.0.56 and it works well in my android device. When it comes to iOS, I am able to view the xaxis and yaxis but not the line when I am binding my item source to my view model.
Things I have done:
- Install syncfusion chart nuget in all of PCL and native projects.
- Added Syncfusion.SfChart.XForms.iOS.Renderers.SfChartRenderer.Init(); after forms init
<StackLayout Padding="0,20,10,20" VerticalOptions="FillAndExpand">
<chart:SfChart VerticalOptions="FillAndExpand" AreaBackgroundColor="#F3F8FF">
<chart:SfChart.PrimaryAxis>
<chart:NumericalAxis Interval="5" ShowMajorGridLines="False">
<chart:NumericalAxis.Title>
<chart:ChartAxisTitle FontFamily="RegularPoppins" Text="Age"></chart:ChartAxisTitle>
</chart:NumericalAxis.Title>
</chart:NumericalAxis>
</chart:SfChart.PrimaryAxis>
<chart:SfChart.SecondaryAxis>
<chart:NumericalAxis Minimum="0" Interval="2" ShowMajorGridLines="False">
<chart:NumericalAxis.LabelStyle>
<chart:ChartAxisLabelStyle LabelFormat="# kg"/>
</chart:NumericalAxis.LabelStyle>
<chart:NumericalAxis.Title>
<chart:ChartAxisTitle FontFamily="RegularPoppins" Text="Weight (in kg)"></chart:ChartAxisTitle>
</chart:NumericalAxis.Title>
</chart:NumericalAxis>
</chart:SfChart.SecondaryAxis>
<chart:FastLineSeries ItemsSource="{Binding WeightChart}" XBindingPath="Age" YBindingPath="Weight" Label="Child">
</chart:SfChart>
</StackLayout>
Hi, I have manage to fix the issue, it is because I am using list instead of
ObservableCollection
- 3 Replies
- 2 Participants
-
CH Choy
- Dec 6, 2021 09:20 AM UTC
- Dec 13, 2021 06:50 AM UTC