RangeColorizer Class
A colorizer that allows providing colors based on which range the SeriesBase.ColorDataMember value belongs.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v18.1.dll
Declaration
[TypeConverter(typeof(RangeColorizerTypeConverter))]
public class RangeColorizer :
ChartPaletteColorizerBase,
IPatternHolder
Remarks
This class introduces the RangeColorizer.RangeStops property that allows specifying range stops used to determine to which range value belongs, and the RangeColorizer.ValueProvider property, that allows specifying the value provider. This allows you to specify how to provide numeric values based on SeriesBase.ColorDataMember values.
For more information about colorizers, refer to the Series Point Colorizer topic.
Example
To use the Range Colorizer, perform the following steps.
- Create a RangeColorizer object and assign it to the SeriesBase.Colorizer property.
- Populate the RangeColorizer.RangeStops collection.
- Specify the ChartPaletteColorizerBase.Palette property if you want to use a non-default palette to colorize chart.
- In addition, it is possible to specify the RangeColorizer.ValueProvider property to customize the way used to provide floating point number values based on color data member values.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-colorize-charts-using-the-range-colorizer-t232519
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace RangeColorizerExample {
static class Program {
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the RangeColorizer class.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.