# Specifying the Color of Each Bar Or Column in the Data Series

## Content



You can specify the color of each bar/column in the data series [PlotElementLoaded](/componentone/api/wpf/online-chart/dotnet-framework-api/C1.WPF.C1Chart.4.6.2/C1.WPF.C1Chart.DataSeries.PlotElementLoaded.html) event using the following code:

```csharp
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];
        };
```

## See Also

[Bubble Charts](/componentone/docs/wpf/online-chart/overview/Types/Bubble)