Back to Devexpress

HeatmapPaletteColorProvider.LegendItemPattern Property

corelibraries-devexpress-dot-xtracharts-dot-heatmap-dot-heatmappalettecolorprovider.md

latest4.1 KB
Original Source

HeatmapPaletteColorProvider.LegendItemPattern Property

Gets or sets the format string that configures legend item text.

Namespace : DevExpress.XtraCharts.Heatmap

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public string LegendItemPattern { get; set; }
vb
Public Property LegendItemPattern As String

Property Value

TypeDescription
String

A format string.

|

Remarks

The LegendItemPattern can contain regular text (displayed as is) and value placeholders in braces. To format numeric values, you can apply Format Specifiers. Use a colon to separate a placeholder and its format specifier.

The following table contains the available placeholders for the HeatmapRangeColorProvider:

PlaceholderDescription
{V1}Displays a start range value.
{V2}Displays a end range value.
{VP1}Displays a start range value as percentage.
{VP2}Displays a end range value as percentage.

The following table contains the available placeholders for the HeatmapKeyColorProvider:

PlaceholderDescription
{V}Displays a key value.

In the following image, the “{VP1:0%} - {VP2:0%}” format string is applied to legend items:

csharp
heatmapRangeColorProvider.LegendItemPattern = "{VP1:0%} - {VP2:0%}";
vb
heatmapRangeColorProvider.LegendItemPattern = "{VP1:0%} - {VP2:0%}"

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the LegendItemPattern property.

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.

winforms-dashboard-custom-items-extension/CS/CustomItemExtension/CustomItems/Heatmap/HeatmapItemControlProvider.cs#L107

csharp
int rangesCount = rangeStops.Count;
provider.LegendItemPattern = usePercentRangeStops ? "{VP1:p0} - {VP2:p0}" : "{V1} - {V2}";
if(usePercentRangeStops) {

winforms-dashboard-custom-items-extension/VB/CustomItemExtension/CustomItems/Heatmap/HeatmapItemControlProvider.vb#L108

vb
Dim rangesCount As Integer = rangeStops.Count
provider.LegendItemPattern = If(usePercentRangeStops, "{VP1:p0} - {VP2:p0}", "{V1} - {V2}")
If usePercentRangeStops Then

See Also

HeatmapPaletteColorProvider Class

HeatmapPaletteColorProvider Members

DevExpress.XtraCharts.Heatmap Namespace