Picture of the chart: http://i.imgur.com/K88FEJd.png
I cannot get the chart to do categories correctly. If you look at the dates in the following data they are all different except if it is a different department. But in the picture they seem to merge for some reason. Can someone explain this?
Here is my return JSON data...
[{"DepartmentName":"Information Technology","TicketDate":"2015-04-01","TicketCt":3},{"DepartmentName":"Information Technology","TicketDate":"2015-04-16","TicketCt":1},{"DepartmentName":"Human Resources","TicketDate":"2015-04-14","TicketCt":1},{"DepartmentName":"Human Resources","TicketDate":"2015-04-15","TicketCt":1}]
Here is my code:
@(Html.Kendo().Chart<
Guardian.ViewModels.TicketCount
>()
.Name("LastTwoWeeks_Tickets")
.Title("Ticket Count In The Past 30 Days")
.Legend(legend => legend
.Position(ChartLegendPosition.Top)
)
.DataSource(ds => ds.Read(read => read
.Action("_NewTicketCtOverTwoWeeks_Read", "Home"))
.Group(group => group.Add(model => model.DepartmentName))
.Sort(sort => sort.Add(model => model.TicketDate).Ascending())
)
.Series(series => series.Line(model => model.TicketCt).Name("#= group.value #"))
.CategoryAxis(axis => axis
.Categories(model => model.TicketDate)
)
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Shared(true)
.Format("{0:N0}")
)
)