Skip to main content

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.v24.1.dll

NuGet Package: DevExpress.Wpf.Charts

Declaration

public DataTemplate LegendMarkerTemplate { get; set; }

Property Value

Type Description
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.

WPF_Strip

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

<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>
See Also