Hi,
I have a chart in Excel i'd like to replicate, i've attached an image of it (Chart1). I've currently gotten this far (Chart2).
Here's the code:
@(Html.Kendo().Chart<UtilisationOverall>() .Name("chart2") .Title("RDO") .Legend(legend => legend .Position(ChartLegendPosition.Top) ) .DataSource(ds => ds .Read(read => read.Action("UserUtilisationListRdoAjax", "Kendo", new { returnType = AjaxReturnType.Json })) .Group(group => { group.Add(model => model.FullName); }) ) .Series(series => { series.Column(model => model.TimesheetHours, categoryExpression: model => model.FullName) .Aggregate(ChartSeriesAggregate.Sum) .Stack(ChartStackType.Normal) .Name("#= group.value #"); }) .SeriesColors(Colours.Blue, Colours.Orange, Colours.Grey, Colours.Yellow, Colours.LightBlue, Colours.Green) .CategoryAxis(axis => axis .Labels(l => l.Rotation(90)) .MajorGridLines(lines => lines.Visible(false)) ) .ValueAxis(axis => axis .Numeric() .Line(line => line.Visible(false)) ) .Tooltip(tooltip => tooltip .Visible(true) .Template("#= series.name #: #= kendo.format('{0:N0}', value) #") ))
2 Issues:
- I'm not sure how to stack the sum of TimesheetHours into the Month and Year from TimesheetWorkDateMonthYear (DateTime)
- I don't now how to get the Key to should the Month and Year instead of the Person (FullName)
My Class:
public class UtilisationOverall{ /// <summary> /// Persons Full Name /// </summary> public string FullName { get; set; } /// <summary> /// Timesheet Work Date Month Year /// </summary> public DateTime TimesheetWorkDateMonthYear { get; set; } /// <summary> /// Timesheet Overhead /// </summary> public string TimesheetOverhead { get; set; } /// <summary> /// Timesheet Hours /// </summary> public double TimesheetHours { get; set; }}