I am trying to create a line chart binding to grouped data, but when I use the code below I get a "CS0411: The type arguments for method 'Kendo.Mvc.UI.Fluent.DataSourceGroupDescriptorFactory<object>.Add<TValue>(System.Linq.Expressions.Expression<System.Func<object,TValue>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly." error when I run it and in Visual Studio it underlines the ".Add" for group.Add and all the property names of the model (see attached screenshot).
Any ideas why?
View:
@model IEnumerable<
IntegrationLoader.Models.Application
>
@(Html.Kendo().Chart()
.Name("chart")
.Title("Fatal Exceptions In Last 10 Days")
.Legend(legend => legend
.Position(ChartLegendPosition.Bottom)
)
.ChartArea(chartArea => chartArea
.Background("transparent")
)
.SeriesDefaults(seriesDefaults =>
seriesDefaults.Line().Style(ChartLineStyle.Smooth)
)
.DataSource(dataSource => dataSource
.Read(read => read.Action("AppCounts_Read", "LogEntries"))
.Group(group => group.Add(model => model.Name))
.Sort(sort => sort.Add(model => model.Day).Ascending())
)
.Series(series =>
{
series.Line(model => model.FatalCount)
.Name("#= group.value # (Count)");
})
.CategoryAxis(axis => axis
.Categories(model => model.Day)
.Labels(labels => labels.Format("yyyyMMdd"))
)
.ValueAxis(axis => axis
.Numeric().Labels(labels => labels.Format("{0}"))
.Line(line => line.Visible(false))
.AxisCrossingValue(-10)
.Title("Errors")
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0}")
)
)
Thanks,
Bill