Skip to main content

ChartCalculatedFieldCollection Class

A collection that stores calculated fields.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public class ChartCalculatedFieldCollection :
    ChartElementCollection<ChartCalculatedField>,
    IEnumerable<ICalculatedField>,
    IEnumerable

The following members return ChartCalculatedFieldCollection objects:

Remarks

The ChartCalculatedFieldCollection is a collection of the ChartCalculatedField objects.

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