maui-devexpress-dot-maui-dot-charts-dot-barseries-e53d680d.md
Gets or sets a colorizer that specifies how to color-code bars. This is a bindable property.
Namespace : DevExpress.Maui.Charts
Assembly : DevExpress.Maui.Charts.dll
NuGet Package : DevExpress.Maui.Charts
public IPointColorizer PointColorizer { get; set; }
| Type | Description |
|---|---|
| IPointColorizer |
The colorizer object.
|
A point colorizer allows you to specify one or more conditions based on which a chart applies colors to series points (bars). For example, point colors indicate the Happy Planet Index (HPI for short) on the following chart:
You can use a predefined colorizer or implement a custom colorizer for series points.
The ChartView ships with point and value range colorizers that use predefined algorithms to select point colors.
Assign a ColorEachPointColorizer object to the PointColorizer property of the series to access colors from the default or custom palette.
You can color series points based on their Y-axis values.
PointColorizer property of the series.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.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.
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:
PointColorizer property of the series.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.In this example, the bar chart displays cryptocurrency portfolio yield. It colors series points red when their Y-axis values are between -100 and 0 , and green when values are between 0 and 100. Note that this chart diagram is rotated.
Create a data source – a list of objects each of which has the Ticker property that returns a string (point argument) and the Profit property that returns a number (point value).
Assign a ValueBandPointColorizer object to the BarSeries.PointColorizer property. Populate the colorizer’s ColorStops collection with two ColorStop objects that specify colors for ranges of point values.
See Also