Hi
I'm using xamarin forms and my sdk browser app is working.
I had tried to implement the telerik chart control in xaml. The chart control shows up with white background and doesn't have the data
The bindingcontext is having data and also there are no errors. Even the control itemsource is having the data. I have followed the getting started documentation.
http://docs.telerik.com/devtools/xamarin/controls/chart/chart-getting-started
Please provide assistance or help to resolve the issue.
using System;
using System.Collections.Generic;
using Telerik.XamarinForms.Chart;
using Xamarin.Forms;
namespace SampleXamarinForms
{
public partial class LineSeries :ContentPage
{
private ChartSelectionBehavior beh;
public GraphViewModel DataContext {
get;
set;
}
public LineSeries()
{
DataContext = new GraphViewModel();
InitializeComponent();
//this.BindingContext = DataContext;
BackgroundColor = Xamarin.Forms.Device.OnPlatform(Xamarin.Forms.Color.White, Xamarin.Forms.Color.White, Xamarin.Forms.Color.Transparent);
this.Content = CreateChart();
this.Content.BindingContext = DataContext;
barChart.BindingContext = DataContext;
}
private static RadCartesianChart CreateChart()
{
var chart = new RadCartesianChart
{
HorizontalAxis = new Telerik.XamarinForms.Chart.CategoricalAxis(),
VerticalAxis = new Telerik.XamarinForms.Chart.NumericalAxis(),
};
var series = CreateSeries();
chart.Series.Add(series);
return chart;
}
private static BarSeries CreateSeries()
{
var series = new Telerik.XamarinForms.Chart.BarSeries();
series.SetBinding(BarSeries.ItemsSourceProperty, new Binding("Data"));
series.ValueBinding = new Telerik.XamarinForms.Chart.PropertyNameDataPointBinding
{
PropertyName = "Value"
};
series.CategoryBinding = new Telerik.XamarinForms.Chart.PropertyNameDataPointBinding
{
PropertyName = "Category"
};
return series;
}
}
}
Regards