As you already know, we've officially released v15.1 and among the new features we're shipping in our Charting libraries for WinForms and WPF is the ability to associate visual information to charts using colors.
In order to provide this functionality, Color (for WinForms) and Brush (for WPF) properties have been added to the SeriesPoint class.
v15.1 also includes support for Colorizers, allowing you to provide a color from data source's data members. At present, our Chart Control ships with the following predefined colorizers.
- Color Object Colorizer – Provides a color object to series points when the data source and its data type can be converted to a color (such as an integer value or string - representing color name or the color).
- Key-Color Colorizer – This colorizer allows color selection based on a key.
- Range Colorizer – Use this colorizer if you want to select a color based on numeric values within a range.
To colorize data, assign the selected colorizer to the Series.Colorizer property and specify the ColorDataMember property value of the series. This data member will be processed as a color item by the Color Object Colorizer, as a key by the Key-Color Colorizer and as a numeric value by the Range Colorizer. In addition to series points colors, colorizers can provide information to legends to effectively explain the actual meaning of colors used.
The following code snippets demonstrate use of colorizers for both our WinForms and WPF Chart Controls.
Here is the resulting chart...