Skip to main content
A newer version of this page is available. .

DateTimeScaleOptionsBase.WorkTimeRules Property

Returns a collection of work time rules which should be applied to the date-time axis scale.

Namespace: DevExpress.Xpf.Charts

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

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Charts, DevExpress.Wpf.Charts

Declaration

public WorkTimeRuleCollection WorkTimeRules { get; }

Property Value

Type Description
WorkTimeRuleCollection

A collection of WorkTimeRule objects.

Property Paths

You can access this nested property as listed below:

Show 13 property paths
Object Type Path to WorkTimeRules
ArgumentAxis3D
.DateTimeScaleOptions .WorkTimeRules
AxisX2D
.DateTimeScaleOptions .WorkTimeRules
AxisX3D
.DateTimeScaleOptions .WorkTimeRules
AxisY2D
.DateTimeScaleOptions .WorkTimeRules
AxisY3D
.DateTimeScaleOptions .WorkTimeRules
CircularAxisY2D
.DateTimeScaleOptions .WorkTimeRules
PolarAxisY2D
.DateTimeScaleOptions .WorkTimeRules
RadarAxisX2D
.DateTimeScaleOptions .WorkTimeRules
RadarAxisY2D
.DateTimeScaleOptions .WorkTimeRules
SecondaryAxisX2D
.DateTimeScaleOptions .WorkTimeRules
SecondaryAxisY2D
.DateTimeScaleOptions .WorkTimeRules
XAxis3D
.DateTimeScaleOptions .WorkTimeRules
YAxis3D
.DateTimeScaleOptions .WorkTimeRules

Example

The following markup shows how to configure work time options.

<dxc:XYDiagram2D.AxisX>
    <dxc:AxisX2D>
        <dxc:AxisX2D.DateTimeScaleOptions>
            <!-- Enable the feature to show only working time on the date-time x-axis. -->
            <dxc:ManualDateTimeScaleOptions WorkTimeOnly="True"
                                            AutoGrid="False"                              
                                            MeasureUnit="Hour" 
                                            GridAlignment="Hour">
                <dxc:ManualDateTimeScaleOptions.WorkTimeRules>
                    <!-- Add a work time rule. -->
                    <!-- Specify weekdays on which this rule should be applied. -->
                    <dxc:WorkTimeRule Weekdays="Monday,Tuesday,Wednesday,Thursday,Friday">
                        <dxc:WorkTimeRule.WorkIntervals>
                            <!-- Specify one or more working time intervals of this rule. -->
                            <dxc:TimeInterval StartHour="09"
                                              StartMinute="00"
                                              StartSecond="00"
                                              EndHour="18"
                                              EndMinute="00"
                                              EndSecond="00"/>
                        </dxc:WorkTimeRule.WorkIntervals>
                    </dxc:WorkTimeRule>
                    <!-- Add one more work time rule. -->
                    <!-- Specify the date to which the rule is applied. -->
                    <dxc:WorkTimeRule Date="02/02/17">
                        <dxc:WorkTimeRule.WorkIntervals>
                            <!-- A time interval can be set as follows. -->
                            <dxc:TimeInterval>9:00:00-18:00:00</dxc:TimeInterval>
                        </dxc:WorkTimeRule.WorkIntervals>
                    </dxc:WorkTimeRule>
                </dxc:ManualDateTimeScaleOptions.WorkTimeRules>
            </dxc:ManualDateTimeScaleOptions>
        </dxc:AxisX2D.DateTimeScaleOptions>
        <!--...-->
    </dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>
See Also