windowsforms-devexpress-dot-xtratreemap-dot-sunburstpalettecolorizerbase-af2d0638.md
Gets or sets the format pattern that is applied to a sunburst legend item’s text.
Namespace : DevExpress.XtraTreeMap
Assembly : DevExpress.XtraTreeMap.v25.2.dll
NuGet Package : DevExpress.TreeMap
[XtraSerializableProperty]
public string LegendItemPattern { get; set; }
<XtraSerializableProperty>
Public Property LegendItemPattern As String
| Type | Description |
|---|---|
| String |
A string that formats legend item text.
|
Patterns can contain regular text (displayed as is) and value placeholders in braces. To format numeric and date/time values, you can apply format specifiers. Use a colon to separate a placeholder and its format specifier (for example, “{V:f0}”).
The following table contains the available placeholders:
| Placeholder | Description |
|---|---|
| {L} | Displays the group name. |
| {V} | Displays the total value of group items. |
This example shows how to color sunburst items based on value ranges and format the legend item text generated for each colorizer range.
using DevExpress.XtraTreeMap;
namespace SunburstFlatDataAdapterSample {
public partial class MainForm : Form {
private void OnLoad(object sender, EventArgs e) {
ColorListLegend legend = new ColorListLegend();
legend.Title.Text = "Revenue by Categories";
sunburstControl.Legend = legend;
sunburstControl.Colorizer = new SunburstPaletteColorizer {
Palette = Palette.Office2016Palette,
VaryColorInGroup = false,
LegendItemPattern = "{L} - ${V}"
};
}
}
}
Imports DevExpress.XtraTreeMap
Namespace SunburstFlatDataAdapterSample
Public Partial Class MainForm
Inherits Form
Private Sub OnLoad(ByVal sender As Object, ByVal e As EventArgs)
Dim legend As ColorListLegend = New ColorListLegend()
legend.Title.Text = "Revenue by Categories"
sunburstControl.Legend = legend
sunburstControl.Colorizer = New SunburstPaletteColorizer With {
.Palette = Palette.Office2016Palette,
.VaryColorInGroup = False,
.LegendItemPattern = "{L} - ${V}"
}
End Sub
End Class
End Namespace
See Also
SunburstPaletteColorizerBase Class