Back to Devexpress

Series.LegendMarkerTemplate Property

wpf-devexpress-dot-xpf-dot-charts-dot-series-3b082b01.md

latest3.3 KB
Original Source

Series.LegendMarkerTemplate Property

Gets or sets the template that defines presentation of the legend marker for this series.

Namespace : DevExpress.Xpf.Charts

Assembly : DevExpress.Xpf.Charts.v25.2.dll

NuGet Package : DevExpress.Wpf.Charts

Declaration

csharp
public DataTemplate LegendMarkerTemplate { get; set; }
vb
Public Property LegendMarkerTemplate As DataTemplate

Property Value

TypeDescription
DataTemplate

The template that configures the legend marker appearance.

|

Remarks

Specify the Indicator.LegendMarkerTemplate property to configure the indicator marker. Use the ConstantLine.LegendMarkerTemplate and Strip.LegendMarkerTemplate properties to change a constant line and strip’s marker.

LegendMarkerTemplate affects the marker that is displayed for the series in the Crosshair Cursor label.

Example

How to: Change Series Marker in a Legend

This example demonstrates how to change appearance of the series marker shown in a legend/Crosshair label.

To specify the marker appearance, assign a DataTemplate object to the Series.LegendMarkerTemplate property:

xaml
<dxc:LineSeries2D DisplayName="{Binding CountryName}"
                  DataSource="{Binding Values}"
                  ArgumentDataMember="Year"
                  ValueDataMember="Value">
    <dxc:LineSeries2D.LegendMarkerTemplate>
        <DataTemplate>
            <StackPanel Orientation="Horizontal">
                <Grid Width="12" Height="12">
                    <Ellipse Stretch="Uniform" 
                             Fill="{Binding Path=MarkerBrush}"
                             Stroke="{Binding Path=MarkerLineBrush}"
                             StrokeThickness="2"/>
                </Grid>
                <TextBlock Text="{Binding Path=Text}" 
                           Margin="4,0,0,0" 
                           VerticalAlignment="Center"
                           Width="55"/>
            </StackPanel>
        </DataTemplate>
    </dxc:LineSeries2D.LegendMarkerTemplate>
</dxc:LineSeries2D>

Implements

LegendMarkerTemplate

See Also

Series Class

Series Members

DevExpress.Xpf.Charts Namespace