Ascending - Descending Not Working in Chart Wrapper

1 posts, 0 answers
  1. steve
    steve avatar
    2 posts
    Member since:
    Aug 2006

    Posted 04 Sep 2012 Link to this post

    When using Ascending / Descending along with the Sort method I get a compile error. For example, this works fine:

        @code
            
            Html.Kendo.Chart(Model).Name("DayChart").Title("CourtPay Daily Totals").
            DataSource(Function(d) d.Read("DayTotals", "CourtPay").
            Group(Function(x) x.Add(Function(m) m.ApplicationCode)).
            Sort(Function(s) s.Add(Function(md) md.PaymentDate))).
            Series(Function(d) d.Bar("Amount")).
            CategoryAxis(Function(a) a.Categories(Function(m) m.PaymentDate)).
            HtmlAttributes(New With {.style = "height:900px; width:700px;"}).
            Theme("Black").
            Render()
        
        End Code

    However, this throws an "Expression Does Not Produce a Value" error:

        @code
            
            Html.Kendo.Chart(Model).Name("DayChart").Title("CourtPay Daily Totals").
            DataSource(Function(d) d.Read("DayTotals", "CourtPay").
            Group(Function(x) x.Add(Function(m) m.ApplicationCode)).
            Sort(Function(s) s.Add(Function(md) md.PaymentDate).Descending)).
            Series(Function(d) d.Bar("Amount")).
            CategoryAxis(Function(a) a.Categories(Function(m) m.PaymentDate)).
            HtmlAttributes(New With {.style = "height:900px; width:700px;"}).
            Theme("Black").
            Render()
        
        End Code
Back to Top