I'm trying to display a Kendo dataviz piechart with the following information.
I'm passing 'results' back from my controller to my view.
My view contains the piechart:
@(Html.Kendo().Chart<PropertyViewModel>()
.Name("chart")
.Title("Properties")
.Legend(legend => legend
.Position(ChartLegendPosition.Top)
)
.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
.Visible(true)
.Format("{0:N0}")
)
)
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);
}