PointSeries.PointColorizer Property
Gets or sets a colorizer that specifies how to color-code series points.
Namespace: DevExpress.XamarinForms.Charts
Assembly: DevExpress.XamarinForms.Charts.dll
NuGet Package: DevExpress.XamarinForms.Charts
Declaration
public IPointColorizer PointColorizer { get; set; }
Property Value
Type | Description |
---|---|
IPointColorizer | A colorizer object. |
Remarks
A point colorizer allows you to specify one or more conditions based on which a chart applies colors to series points.
You can use a predefined colorizer or implement a custom colorizer for series points.
Use a Predefined Colorizer
The ChartView ships with point and value range colorizers that use predefined algorithms to select point colors.
- Point Colorizer
Assign a ColorEachPointColorizer object to the PointColorizer property of the series to access colors from the default or custom palette.
- Value Range Colorizer
You can color series points based on their Y-axis values.
- Assign a ValueBandPointColorizer object to the PointColorizer property of the series.
- Populate the colorizer’s ColorStops collection with ColorStop objects. Each ColorStop object defines a value range (a pair of Y-axis values) and color. If a Y-axis value falls within the range, the point is painted with this color.
Implement a Custom Colorizer
- Point Colorizer
The ChartView can color points of a series according to a custom algorithm based on point arguments/values and values of the chart’s bound data source.
Create a class that implements the ICustomPointColorizer or IIndexBasedCustomPointColorizer interface and assign this class instance to the PointColorizer property of the series.
- Value Range Colorizer
A predefined value range colorizer colors points according to their Y-axis values. If you require a series point color to indicate a value of the specified data source field, implement a custom value range colorizer. To do this:
- Assign a CustomValueBandPointColorizer object to the PointColorizer property of the series.
- Create a class that implements the ICustomColorizerNumericValueProvider interface and its GetValueForColorizer method that returns a value from the data source based on which a series point should be colored. Assign this class value to the colorizer’s ValueProvider property.
- Populate the colorizer’s ColorStops collection with ColorStop objects. Each ColorStop object defines a value range and color. If a value that the GetValueForColorizer method returns for a series point falls within the range, the point is painted with this color.