Skip to main content

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