Properties
-
LegendProvider: Gets or sets the chart provider that the RadLegendControl will use to display its items.
Example 1: Setting the LegendProvider
<telerikPrimitives:RadLegendControl LegendProvider="{Binding ElementName=chartName}"/>
-
ItemsPanel: Represents the items panel that will be used by the legend to display its data.
Example 2: Setting the ItemsPanel
<telerikPrimitives:RadLegendControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel/> </ItemsPanelTemplate> </telerikPrimitives:RadLegendControl.ItemsPanel>
-
ItemTemplate: Gets or sets the DataTemplate used to display each legend item.
Example 3: Setting the ItemTemplate
<telerikPrimitives:RadLegendControl.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <Ellipse Fill="{Binding Fill}" Stroke="{Binding Stroke}" StrokeThickness="1" Width="10" Height="10"/> <TextBlock Text="{Binding Title}" Foreground="{Binding Fill}" Margin="10"> </TextBlock> </StackPanel> </DataTemplate> </telerikPrimitives:RadLegendControl.ItemTemplate>
-
LegendItems: Represents a collection of LegendItem items that will be displayed. It can be used in Unbound Mode, i.e., you don't use the LegendProvider property to bind to a chart's source, but manually create your custom LegendItems.
Example 4: Populating the LegendItems
<telerikPrimitives:RadLegendControl> <telerikPrimitives:RadLegendControl.LegendItems> <telerikPrimitives:LegendItem Stroke="LightGreen" Fill="Black" Title="Green"/> <telerikPrimitives:LegendItem Stroke="Yellow" Fill="Black" Title="Yellow"/> </telerikPrimitives:RadLegendControl.LegendItems> </telerikPrimitives:RadLegendControl>
See Also
Implement a Legend Control for a Cartesian Chart with Area Serie
- Implement a Legend Control for a PieSeries