You can specify the position where you want to display the legend using the LegendPosition property of the Sunburst chart. Legend helps in displaying the series of a chart with a predefined symbol and name of the series.
The position of legend is by default set to "Auto", which means the legend positions itself automatically depending on the real estate available on the device. This allows the Sunburst to efficiently occupy the available space on the device. Users have the option to customize the appearance of the legend and enhance the visual appeal of the Sunburst Chart control.
The image below shows how the Sunburst Chart appears after applying the properties.
The following code example demonstrates how to set these properties in C# and XAML. This examples uses the sample created in the Quick Start section.
C# |
Copy Code
|
---|---|
sunburst.LegendPosition = ChartPositionType.Bottom; sunburst.LegendOrientation = Orientation.Horizontal; sunburst.LegendStyle.Stroke = Color.Aqua; sunburst.LegendStyle.StrokeThickness = 2; |
XAML |
Copy Code
|
---|---|
<c1:C1Sunburst x:Name="sunburst" Binding="Value" BindingName="Year,Quarter,Month" LegendPosition="Bottom" LegendOrientation="Horizontal"> <c1:C1Sunburst.LegendStyle> <c1:ChartStyle Stroke="Aqua" StrokeThickness="4"></c1:ChartStyle> </c1:C1Sunburst.LegendStyle> |