Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Got "Index was outside the bounds of the array" when use Telerik Chart

$
0
0

my code

    public static List<CategoricalData> GetCategoricalData()
    {
        List<CategoricalData> data = new List<CategoricalData>();
        for (int i = 0; i < 90 ; i++)
        {
            data.Add(new CategoricalData() { Value = 10+i, Category = "" });
        }

        return data;
    }

Chart :

       var chart = new Telerik.XamarinForms.Chart.RadCartesianChart
        {
            VerticalAxis = new Telerik.XamarinForms.Chart.CategoricalAxis(),
            HorizontalAxis = new Telerik.XamarinForms.Chart.NumericalAxis(),
            HeightRequest = 400,
        };

        var series = new Telerik.XamarinForms.Chart.BarSeries();

        series.ItemsSource = GetCategoricalData();

        series.ValueBinding = new Telerik.XamarinForms.Chart.PropertyNameDataPointBinding
        {
            PropertyName = "Value"
        };

        series.CategoryBinding = new Telerik.XamarinForms.Chart.PropertyNameDataPointBinding
        {
            PropertyName = "Category"
        };

        chart.Series.Add(series);

  Frame asd = new Frame ();
      asd.Contect = chart;
      this.Content = asd;

i want display 80 multiline in chart please help me.


Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>