The index WAS off limits . It Must Be not negative and Must Be Less Than the size of the collection.

2 posts, 0 answers
  1. EssMus
    EssMus avatar
    18 posts
    Member since:
    Jan 2015

    Posted 21 Apr 2015 Link to this post

    hi,

    i'm using code from documentation 

    http://www.telerik.com/help/aspnet-ajax/htmlchart-important-changes-regarding-the-series-declaration.html

     

     Programmatic creation of the Area chart with the SeriesItems collection.

    and i have error wich it's apear in pic  

    plz help

  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1492 posts

    Posted 22 Apr 2015 Link to this post

    Hi Essoufi,

    It seems that the chart doesn't have a series with zero index. You can try to add a series instead of accessing a non-existing one:
    ASPX:
    <telerik:RadHtmlChart runat="server" ID="Chart1" Width="600px" Height="400px">
    </telerik:RadHtmlChart>
    C#:
    protected void Page_Load(object sender, EventArgs e)
    {
        AreaSeries areaSeries = new AreaSeries();
        CategorySeriesItem csi1 = new CategorySeriesItem() { Y = 20 };
        CategorySeriesItem csi2 = new CategorySeriesItem() { Y = 35 };
        CategorySeriesItem csi3 = new CategorySeriesItem() { Y = 40 };
        areaSeries.SeriesItems.Add(csi1);
        areaSeries.SeriesItems.Add(csi2);
        areaSeries.SeriesItems.Add(csi3);
        Chart1.PlotArea.Series.Add(areaSeries);
    }



    Regards,
    Danail Vasilev
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top