Take the 2-minute tour ×

I'm trying to display a Kendo dataviz piechart with the following information.

I'm passing 'results' back from my controller to my view.

results is what I'm passing back to my view.

My view contains the piechart:

        .Legend(legend => legend
        .DataSource(ds => ds.Read(read => read.Action("GetPropertiesChart", "Home")))
        .Series(series => {
            series.Pie(model => model.Address.State, model => model.Address.State.Count().ToString());
        .Tooltip(tooltip => tooltip

I get nothing but a blank area on my page where the piechart should be.

Controller code:

public ActionResult GetPropChart()
        var allProps = PService.GetAll();

        var props = allProps.Cast<PropViewModel>().ToList();

        var results = props
                .GroupBy(item => item.Address.State)
                .Select(g => new
                    State = g.Key,
                    Count = g.Select(l => l.Address.State).Count()

        return Json(results);
share|improve this question
How does the controller action method which serves the data look like? Also are there any JavaScript errors in the console? What browser do you use? Did you try to pass the collection to the BindTo method and see if it works at all? –  Petur Subev Jan 20 '13 at 22:07
I've added the controller code above. I get no JavaScript errors and I'm using Chrome. I did not try passing the collection to the BindTo method but I'll give that a shot. –  Mithrilhall Jan 21 '13 at 13:08
add comment

1 Answer

up vote 0 down vote accepted

The model you return is as follows:

.Select(g => new
          State = g.Key,

However your series definition are different (there is no Adress property)

series.Pie(model => model.Address.State)

Also binding to methods (such as model.Address.State.Count().ToString()) is Not supported - created regular property which holds the value instead.

share|improve this answer
add comment

Your Answer


