I'm having some troubles trying to initialize a variable always when I try to do it with the SfChart I get this error: "Cannot cast from source type to destination type."
This is my code:
XML:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:syncfusion="clr-namespace:Syncfusion.SfChart.Android;assembly:Syncfusion.SfChart.Android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.syncfusion.charts.SfChart
android:id="@+id/chartWeeklyResult"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1">
</com.syncfusion.charts.SfChart>
</LinearLayout>
C#:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Com.Syncfusion.Charts;
using Com.Syncfusion.Charts.Enums;
using Android.Graphics;
namespace Stop_Diabetes_Android
{
[Activity (Label = "Statistics")]
public class StatisticsActivity : Activity
{
private SfChart chartIn;
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView(Resource.Layout.Statistics);
try{
chartIn = (SfChart) FindViewById (Resource.Id.chartWeeklyResult);
}
catch (Exception ex) {
}
}
}
}
I'd like to know if someone know how to fix it. Thanks for your worthy time and help.