Hi,
Below is my code and i am trying to pass model inside array but i am always getting null value even there is data, can anyone help me how to pass model inside array.
------Partial view----
@(Html.Kendo().Chart<DashboardRepairMaintenance>()
.Name("chart3")
.Title("Repair and maintenance status")
.HtmlAttributes(new { style = "width: 550px; height: 170px; border: transparent; margin-left:5px; " })
.DataSource(dataSource => dataSource
.Read(read => read.Action("_DashboardRepairMaintenance", "DashboardRepairMaintenance"))
)
.Series(series =>
{
series
.Column(new int[] {(int)Model.FirstOrDefault().ACTIVE , (int)Model.FirstOrDefault().PENDING ,(int)Model.FirstOrDefault().CARFWD }
)
.Name("Active").Stack("Active");
})
.CategoryAxis(axis => axis
.Categories(model => model.DAYS)
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
.MajorUnit(2)
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0:N0}")
)
)
------Controller---------------
public ActionResult _DashboardRepairMaintenance()
{
return Json(_dashboardRepository.GetRepairMaintenance());
}
--------Model class-------
public class DashboardRepairMaintenance
{
public string DAYS { get; set; }
public int? ACTIVE { get; set; }
public int? PENDING { get; set; }
public int? CARFWD { get; set; }
}
Below is my code and i am trying to pass model inside array but i am always getting null value even there is data, can anyone help me how to pass model inside array.
------Partial view----
@(Html.Kendo().Chart<DashboardRepairMaintenance>()
.Name("chart3")
.Title("Repair and maintenance status")
.HtmlAttributes(new { style = "width: 550px; height: 170px; border: transparent; margin-left:5px; " })
.DataSource(dataSource => dataSource
.Read(read => read.Action("_DashboardRepairMaintenance", "DashboardRepairMaintenance"))
)
.Series(series =>
{
series
.Column(new int[] {(int)Model.FirstOrDefault().ACTIVE , (int)Model.FirstOrDefault().PENDING ,(int)Model.FirstOrDefault().CARFWD }
)
.Name("Active").Stack("Active");
})
.CategoryAxis(axis => axis
.Categories(model => model.DAYS)
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
.MajorUnit(2)
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Format("{0:N0}")
)
)
------Controller---------------
public ActionResult _DashboardRepairMaintenance()
{
return Json(_dashboardRepository.GetRepairMaintenance());
}
--------Model class-------
public class DashboardRepairMaintenance
{
public string DAYS { get; set; }
public int? ACTIVE { get; set; }
public int? PENDING { get; set; }
public int? CARFWD { get; set; }
}