windowsforms-devexpress-dot-xtramap-dot-mappie.md
Gets or sets segments of a map pie.
Namespace : DevExpress.XtraMap
Assembly : DevExpress.XtraMap.v25.2.dll
NuGet Package : DevExpress.Win.Map
[DefaultValue(null)]
public PieSegmentCollection Segments { get; set; }
<DefaultValue(Nothing)>
Public Property Segments As PieSegmentCollection
| Type | Default | Description |
|---|---|---|
| PieSegmentCollection | null |
A PieSegmentCollection object that is a collection of map path segments.
|
char letter = 'A';
double defaultValue = 10;
MapPie pie;
private void Form1_Load(object sender, EventArgs e) {
MapItemStorage storage = new MapItemStorage();
pie = new MapPie() {
Location = new GeoPoint(51.507222, -0.1275),
Size = 100,
Argument = "pie",
};
pie.Segments.Add(new PieSegment() { Argument = NextLetter(), Value = defaultValue });
pie.Segments.Add(new PieSegment() { Argument = NextLetter(), Value = defaultValue });
pie.Segments.Add(new PieSegment() { Argument = NextLetter(), Value = defaultValue });
storage.Items.Add(pie);
mapControl1.Layers.Add(new VectorItemsLayer() {
Data = storage,
Colorizer = new KeyColorColorizer() {
ItemKeyProvider = new ArgumentItemKeyProvider(),
PredefinedColorSchema = PredefinedColorSchema.Palette
}
});
lbRotationDirection.DataSource = Enum.GetValues(typeof(RotationDirection));
lbSegments.DataSource = pie.Segments;
}
string NextLetter() {
return letter++.ToString();
}
Private letter As Char = "A"c
Private defaultValue As Double = 10
Private pie As MapPie
Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
Dim storage As New MapItemStorage()
pie = New MapPie() With {.Location = New GeoPoint(51.507222, -0.1275), .Size = 100, .Argument = "pie"}
pie.Segments.Add(New PieSegment() With {.Argument = NextLetter(), .Value = defaultValue})
pie.Segments.Add(New PieSegment() With {.Argument = NextLetter(), .Value = defaultValue})
pie.Segments.Add(New PieSegment() With {.Argument = NextLetter(), .Value = defaultValue})
storage.Items.Add(pie)
mapControl1.Layers.Add(New VectorItemsLayer() With { _
.Data = storage, .Colorizer = New KeyColorColorizer() With {.ItemKeyProvider = New ArgumentItemKeyProvider(), .PredefinedColorSchema = PredefinedColorSchema.Palette} _
})
lbRotationDirection.DataSource = System.Enum.GetValues(GetType(RotationDirection))
lbSegments.DataSource = pie.Segments
End Sub
Private Function NextLetter() As String
Dim tempVar As Char = letter
letter = ChrW(AscW(letter) + 1)
Return tempVar.ToString()
End Function
See Also