Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ChartCommands.AddIndicatorCommand Property

Specifies the command that adds an indicator to the chart.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

#Declaration

public ICommand<object> AddIndicatorCommand { get; set; }

#Property Value

Type Description
ICommand<Object>

An object that defines a command.

#Remarks

This command plots a given indicator based on an active series. You can pass an object of a Indicator descendant or a required indicator type to the command parameters.

The following example shows how to use AddIndicatorCommand to add a SimpleMovingAverage indicator to the chart.

<dxc:ChartControl x:Name="chart">
    <!--...-->
</dxc:ChartControl>
<dx:SimpleButton VerticalAlignment="Bottom" Width="100" Height="50" Content="Add SMA" 
                 Command="{Binding Commands.AddIndicatorCommand, ElementName=chart}">
    <dx:SimpleButton.CommandParameter>
        <dxc:SimpleMovingAverage LegendText="SMA"/>
    </dx:SimpleButton.CommandParameter>
</dx:SimpleButton>
See Also