我有一个剑道图表,如下所示:
@(Html.Kendo().Chart<SchoolYearWorkScheduleModel>()
.Name("chart")
.Title("Beskæftigelses Graf")
.Legend(legend => legend
.Position(ChartLegendPosition.Left)
)
.DataSource(ds => ds.Read(read => read.Action("Read", "EmploymentGraph")))
.Series(series =>
{
series.Line(model => model.TotalWorkHours).Name("Total Beskæftigelse").Markers(z => z.Visible(false)).Style(ChartLineStyle.Normal);
...
控制器:
[HttpPost]
public ActionResult Read()
{
var res = _schoolYearWorkScheduleRepository.GetModel();
return Json(res);
}
存储库:
public SchoolYearWorkScheduleModel GetModel()
{
schoolYearWorkScheduleModel.ID = DateTime.Now.SchoolYear();
schoolYearWorkScheduleModel.TotalWorkHours = TotalWorkHours(DateTime.Now, 1);
return schoolYearWorkScheduleModel;
}
控制器 Read 方法返回的 Json 结果为我提供了应有的数据。但图表中根本没有显示任何内容。而且我看不出我做错了什么。?