Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to: Use a Custom Measure Units in Automatic Date-Time Scale Mode

  • 2 minutes to read

To specify a custom Date-Time measure unit for automatic scale mode, assign an object of a class implementing the IDateTimeMeasureUnitsCalculator interface to the AutomaticDateTimeScaleOptions.AutomaticMeasureUnitsCalculator property of an AutomaticDateTimeScaleOptions object assigned to the AxisX2D.DateTimeScaleOptions.

<dxc:XYDiagram2D.AxisX>
    <dxc:AxisX2D>
        <dxc:AxisX2D.DateTimeScaleOptions>
            <dxc:AutomaticDateTimeScaleOptions>
                <dxc:AutomaticDateTimeScaleOptions.AutomaticMeasureUnitsCalculator>
                    <local:CustomDateTimeMeasureUnitsCalculator/>
                </dxc:AutomaticDateTimeScaleOptions.AutomaticMeasureUnitsCalculator>
            </dxc:AutomaticDateTimeScaleOptions>
        </dxc:AxisX2D.DateTimeScaleOptions>
        <dxc:AxisX2D.Label>
            <dxc:AxisLabel TextPattern="{}{A:MMMM yy}"/>
        </dxc:AxisX2D.Label>
    </dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>