Skip to main content

ChartCalculatedField.Expression Property

Gets or sets an expression the calculated field uses to evaluate its values.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public string Expression { get; set; }

Property Value

Type Description
String

A string that represents an expression written in Criteria Language.

Example

The following example shows how to create a calculated field and then use this field as a data source for a series. The field’s values are calculated by the following expression: [Time.Seconds] * [Velocity].

<dxc:ChartControl x:Name="chartControl">
    <dxc:ChartControl.DataContext>
        <local:ChartViewModel/>
    </dxc:ChartControl.DataContext>
    <dxc:ChartControl.CalculatedFields>
        <dxc:ChartCalculatedField FieldName="Displacement" 
                                  Expression="[Time.Seconds] * [Velocity]" 
                                  FieldType="Double"/>
    </dxc:ChartControl.CalculatedFields>
    <dxc:XYDiagram2D>
        <dxc:SplineSeries2D DisplayName="Series" 
                            DataSource="{Binding DataPoints}"
                            ArgumentDataMember="Time"
                            ValueDataMember="Displacement" 
                            CrosshairLabelPattern="{}{Displacement:f1}" 
                            MarkerVisible="True"/>
        ...
    </dxc:XYDiagram2D>
</dxc:ChartControl>
See Also