CustomLegendItem.MarkerTemplate Property

Gets or sets the template used to visualize the custom legend item marker.

Namespace: DevExpress.Xpf.Charts

Assembly: DevExpress.Xpf.Charts.v21.1.dll

Declaration

public DataTemplate MarkerTemplate { get; set; }

Property Value

Type Description
DataTemplate

A DataTemplate object.

Example

To add a custom legend item to a legend, create a new instance of the CustomLegendItem class and add it to the Legend.CustomItems collection. Then, configure the custom item, for example, using the CustomLegendItem.Text property to set the item’s text and the CustomLegendItem.MarkerTemplate property to set the item’s marker.

View Example

<Window.Resources>
    <DataTemplate x:Key="markerTemplate">
        <Image Source="Images/DXLogo.png"/>
    </DataTemplate>
</Window.Resources>
        <dxc:ChartControl.Legend>
            <dxc:Legend ItemVisibilityMode="AutoGeneratedAndCustom">
                <dxc:Legend.CustomItems>
                    <dxc:CustomLegendItem MarkerBrush="#FFFF8000" 
                                          MarkerTemplate="{Binding Source={StaticResource markerTemplate}}" 
                                          Text="Powered by DevExpress"/>
                </dxc:Legend.CustomItems>
            </dxc:Legend>
        </dxc:ChartControl.Legend>
See Also