Binding line series to Array/List

2 posts, 0 answers
  1. Andrey
    Andrey avatar
    8 posts
    Member since:
    Aug 2012

    Posted 30 Aug 2012 Link to this post

    I have my model described like: 
        public class PerformanceChartSeriesModel_2
            public string[] Date { get; set; }
            public double[] P1 { get; set; }

    Now, I chart :
            .Legend(legend => legend
            .DataSource(ds => ds
                .Read(read => read.Action("PerformanceChartData", "Performance").Data("performanceChartData"))
           .Series(series =>
                   .CategoryAxis(axis =>
                       axis.Categories(l => l.Date);

    Neither series nor categories pick up values, series actually behave in a strange way drawing only one point.
    Could you tell what is wrong, or how can I work with such model.
  2. Hristo Germanov
    Hristo Germanov avatar
    703 posts

    Posted 03 Sep 2012 Link to this post

    Hello Andrey Dorokhov,

    As you can see in our offline example line-charts/remote-data you need to pass an array with objects. Then you need to specify the bindable field.

    If you want to pass an array to the series you can do this with ViewBag or Model.Something.

    Kind regards,
    Hristo Germanov
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top