Skip to main content

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>