Skip to main content

AutomaticTimeSpanScaleOptions Class

Contains scale settings for an axis when its scale mode is automatic.

Namespace: DevExpress.Xpf.Charts

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

NuGet Package: DevExpress.Wpf.Charts

Declaration

public class AutomaticTimeSpanScaleOptions :
    TimeSpanAggregationScaleOptionsBase

Remarks

The automatic options allow the Chart Control to automatically define the optimal measurement unit for an axis based on the input data, the chart size, and the zoom level.

You can use an AutomaticTimeSpanScaleOptions object to specify the AxisX2D.TimeSpanScaleOptions, AxisX3D.TimeSpanScaleOptions, and RadarAxisX2D.TimeSpanScaleOptions properties.

The AggregateFunction property allows you to define how to summarize data on each interval defined by a measurement unit.

If predefined aggregate functions do not meet your requirements, define CustomAggregateFunction.

To learn more, see Data Aggregation.

You can change an algorithm used to calculate a measurement unit. To do this, use the AutomaticMeasureUnitsCalculator property.

Example

This code snippet shows how to access the automatic date time scale options for the x-axis scale and specify the aggregate function.

<dxc:ChartControl>
    <dxc:XYDiagram2D>
        <!--. . .-->
        <dxc:XYDiagram2D.AxisX>
            <dxc:AxisX2D>
                <dxc:AxisX2D.TimeSpanScaleOptions>
                    <dxc:AutomaticTimeSpanScaleOptions AggregateFunction="Sum"/>
                </dxc:AxisX2D.TimeSpanScaleOptions>
            </dxc:AxisX2D>
        </dxc:XYDiagram2D.AxisX>
    </dxc:XYDiagram2D>
</dxc:ChartControl>
See Also