I try to set fix categories in my kendo chart for all day of week, also when didn't have value and I just want the 5 days of european weeks like monday to friday. Second problem, I can't set culture to have the name of day in french.
@(Html.Kendo().Calendar()
.Name("calendar")
.Value(DateTime.Now)
.Format("dd/MM/yyyy")
.Events(e => e.Change("refreshGrid"))
)
</div>
@(Html.Kendo().Chart<RapportTache>()
.Name("chart")
.Title("Rapport de la semaine")
.Legend(legend => legend
.Position(ChartLegendPosition.Top)
)
.DataSource(ds => ds
.Read(read => read.Action("Chart_Read", "Saisie").Data("getDateTime"))
.Group(group => group.Add(model => model.TacheLibelle))
.Sort(sort => sort.Add(model => model.RapportTacheJourDate).Ascending())
)
.Series(series =>
{
series.Column(model => model.RapportTacheJourDuree, categoryExpression: model => model.RapportTacheJourDate).Stack(true);
})
.CategoryAxis(axis => axis
.Labels(labels => labels
.Culture("fr-FR")
.DateFormats(formats => formats
.Days("dddd dd")
)
)
.MajorGridLines(lines => lines.Visible(false))
)
.SeriesColors(
"#cd1533", "#d43851", "#dc5c71", "#e47f8f", "#eba1ad",
"#009bd7", "#26aadd", "#4db9e3", "#73c8e9", "#99d7ef"
)
.ChartArea(h => h.Height(300))
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
.MajorUnit(10)
.Line(line => line.Visible(false))
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Template("#= dataItem.RapportTacheJourDuree # (heures) : #= dataItem.TacheLibelle #")
)
)
And this is the actual result :
[![enter image description here][1]][1]
[1]: http://i.stack.imgur.com/xa3pP.png
In the actual situtation, I just have the monday on null value. If anyone have an idea, thank's for help ! :)
@(Html.Kendo().Calendar()
.Name("calendar")
.Value(DateTime.Now)
.Format("dd/MM/yyyy")
.Events(e => e.Change("refreshGrid"))
)
</div>
@(Html.Kendo().Chart<RapportTache>()
.Name("chart")
.Title("Rapport de la semaine")
.Legend(legend => legend
.Position(ChartLegendPosition.Top)
)
.DataSource(ds => ds
.Read(read => read.Action("Chart_Read", "Saisie").Data("getDateTime"))
.Group(group => group.Add(model => model.TacheLibelle))
.Sort(sort => sort.Add(model => model.RapportTacheJourDate).Ascending())
)
.Series(series =>
{
series.Column(model => model.RapportTacheJourDuree, categoryExpression: model => model.RapportTacheJourDate).Stack(true);
})
.CategoryAxis(axis => axis
.Labels(labels => labels
.Culture("fr-FR")
.DateFormats(formats => formats
.Days("dddd dd")
)
)
.MajorGridLines(lines => lines.Visible(false))
)
.SeriesColors(
"#cd1533", "#d43851", "#dc5c71", "#e47f8f", "#eba1ad",
"#009bd7", "#26aadd", "#4db9e3", "#73c8e9", "#99d7ef"
)
.ChartArea(h => h.Height(300))
.ValueAxis(axis => axis.Numeric()
.Labels(labels => labels.Format("{0:N0}"))
.MajorUnit(10)
.Line(line => line.Visible(false))
)
.Tooltip(tooltip => tooltip
.Visible(true)
.Template("#= dataItem.RapportTacheJourDuree # (heures) : #= dataItem.TacheLibelle #")
)
)
And this is the actual result :
[![enter image description here][1]][1]
[1]: http://i.stack.imgur.com/xa3pP.png
In the actual situtation, I just have the monday on null value. If anyone have an idea, thank's for help ! :)