I want to display a kendo Chart with colums and to do so, I use this razor code :
@(Html.Kendo().Chart(results)
.Name("line-chart")
.Title("The chart based on lines")
.SeriesDefaults(sd=>sd.Line().Markers(false))
.Legend(l=>l.Position(ChartLegendPosition.Bottom))
.ChartArea(ca=>ca.Background("transparent"))
.Series(series =>
{
series.Column(
point => point.Pluie,
date => date.Date,
null)
.Axis("Pluie")
.Name("Pluie")
.Gap(0)
.Stack(true)
.Highlight(true)
.Color("Red");
})
.ValueAxis(v =>
{
v.Numeric("Pluie").Min(0).Max(25);
})
.CategoryAxis(c=>c.Labels(l=>l.Visible(false)))
.Tooltip(t=>t.Visible(true).Template("Value : #=value# Date : #=category#")))
Everything works well, exept one thing. My bars have to be red, and they are always black, even if I put this : "Color("Red");" to my razor code.
Is anyone having the same issue ?
You need to put the colour inside series.Column as the second parameter, eg:
Or in a separate part of the factory: