0

I have a Kendo chart looking like:

@(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);
...

CONTROLLER:

        [HttpPost]
    public ActionResult Read()
    {
        var res = _schoolYearWorkScheduleRepository.GetModel();
        return Json(res);
    }

Repository:

      public SchoolYearWorkScheduleModel GetModel()
    {
        schoolYearWorkScheduleModel.ID = DateTime.Now.SchoolYear();
        schoolYearWorkScheduleModel.TotalWorkHours = TotalWorkHours(DateTime.Now, 1);
        return schoolYearWorkScheduleModel;
    }

The Json result that the controller Read method returns gives me the data, that it should. But nothing at all shows up in the chart graph. And I cannot see what I am doing wrong. ?

Moelbeck
  • 591
  • 2
  • 7
  • 29
  • If I chose to just return the `return Json(res.TotalWorkHours);`, it shows the data. but then I can only show data for that single list. And I have two list within the object that the chart has to show data from ` – Moelbeck Jun 15 '14 at 21:39

1 Answers1

0

You can add new property to your class for the new list and add two series in your chart. If this is not what you are looking for can you please also specify what you are trying achieve with two lists and what you want the output in chart.

Nitin Mall
  • 462
  • 2
  • 5