In this example, the bar chart displays monthly values colored based on the season. For a complete description, refer to the following help topic: Series Point Colorizers.
To paint bars according to the season, assign a custom colorizer to a bar series' PointColorizer property. In this example, the custom colorizer selects a color depending on the month's serial number.
<dxc:BarSeries PointColorizer="{local:CustomColorizer}">
<!--...-->
</dxc:BarSeries>
public class CustomColorizer : ICustomPointColorizer {
Color ICustomPointColorizer.GetColor(ColoredPointInfo info
switch (info.DateTimeArgument.Month) {
case 12:
case 1:
case 2:
default:
return Color.FromHex("#5982db");
case 3:
case 4:
case 5:
return Color.FromHex("#755dd9");
case 6:
case 7:
case 8:
return Color.FromHex("#9b57d3");
case 9:
case 10:
case 11:
return Color.FromHex("#92278f");
}
}
public ILegendItemProvider GetLegendItemProvider() {
return null;
}
}