I have a chart with the following definition:
@(Html.Kendo().Chart<ChartViewModel>()
.Name("MyChart")
.DataSource(d => d
.WebApi()
.Read(r => r.Action("GetData", "api/Chart").Data("MyChartData"))
.Group(g => g.Add(n => n.Group))
)
.Legend(l => l.Position(ChartLegendPosition.Bottom).Labels(n => n.Template("#=series._groupValue#")))
.Series(s => s.Column(n => n.Value, n => n.Colour).Stack(true))
.CategoryAxis(c => c.Categories(n => n.Category))
.ValueAxis(a => a.Numeric())
.Tooltip(t => t.Visible(true).Template("#=value# - #= category #"))
)
Note in particular the series definition; I can control the color of individual data points in the chart. This is great.
...but the groups displayed in the legend doesn't take on these colors
I know that I can add the following line to control the group colors:
.SeriesColors(new string[] { "#color1", "#color2", "etc..." })
...but this doesn't guarantee that any particular group will get a specific color. I know in advance what the groups will be, and what colors I want each one to have. ...this seems like a very obvious and simple requirement, but the chart definition doesn't appear to support this for some reason? How do I achieve this?