Skip to main content

Series3DDataSourceAdapter.CalculatedFields Property

Returns a collection of calculated fields.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public ChartCalculatedFieldCollection CalculatedFields { get; }

Property Value

Type Description
ChartCalculatedFieldCollection

A collection that stores calculated fields.

Remarks

Calculated fields allow you to evaluate values based on an expression and use them as a data source for series arguments, values, crosshair labels, and so on.

To add a calculated field to a Chart3D Control, add a ChartCalculatedField object to the adapter’s CalculatedFields collection and specify its parameters.

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: [X] * [Y].

<dxc:Chart3DControl AspectRatio="1 1 0.5">
    <dxc:Chart3DControl.DataContext>
        <local:ChartViewModel/>
    </dxc:Chart3DControl.DataContext>
    <dxc:Series3DDataSourceAdapter SeriesDataMember="Name" 
                                   XArgumentDataMember="X" 
                                   YArgumentDataMember="Y" 
                                   ValueDataMember="Value" 
                                   DataSource="{Binding DataPoints}">
        <dxc:Series3DDataSourceAdapter.CalculatedFields>
            <dxc:ChartCalculatedField FieldName="Value" 
                                      Expression="[X]*[Y]" 
                                      FieldType="Double"/>
        </dxc:Series3DDataSourceAdapter.CalculatedFields>
        <dxc:Series3DDataSourceAdapter.SeriesTemplate>
            <dxc:Series3DTemplate>
                <dxc:Series3DTemplate.View>
                    <dxc:Point3DSeriesView/>
                </dxc:Series3DTemplate.View>
            </dxc:Series3DTemplate>
        </dxc:Series3DDataSourceAdapter.SeriesTemplate>
    </dxc:Series3DDataSourceAdapter>
</dxc:Chart3DControl>
See Also