You can specify the color of each bar/column in the data series PlotElementLoaded event using the following code:
C# |
Copy Code
|
---|---|
var palette = new Brush[] { Brushes.Red, Brushes.Plum, Brushes.Purple }; dataSeries.PlotElementLoaded += (s, e) => { PlotElement pe = (PlotElement)s; if (pe.DataPoint.PointIndex >= 0) pe.Fill = palette[pe.DataPoint.PointIndex % palette.Length]; }; |