This document explains how to exclude non-working days and time from the date-time x-axis scale.
Workdays Options allow you to exclude non-working days or add strict workdays.
DateTimeScaleOptionsBase.WorkdaysOnly = false |
DateTimeScaleOptionsBase.WorkdaysOnly = true |
 |
 |
The following markup shows how to configure the workdays options.
Xaml |
<dxc:XYDiagram2D.AxisX>
<dxc:AxisX2D>
<dxc:AxisX2D.DateTimeScaleOptions>
<dxc:ManualDateTimeScaleOptions WorkdaysOnly="True">
<dxc:ManualDateTimeScaleOptions.WorkdaysOptions>
<dxc:WorkdaysOptions Workdays="Monday,Tuesday,Wednesday,Thursday,Friday"
Holidays="01/01/2017,01/02/2017"
ExactWorkdays="01/21/2017"/>
</dxc:ManualDateTimeScaleOptions.WorkdaysOptions>
</dxc:ManualDateTimeScaleOptions>
</dxc:AxisX2D.DateTimeScaleOptions>
</dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>
|
The markup above uses the following classes and properties to specify workdays.
Note that instead of manually specifying holiday dates, you can import them from the DevExpress Scheduler (.xml) or Microsoft Office Outlook® (.hol) file using the WorkdaysOptions.LoadHolidays method.
Work Time Rules allow you to specify time intervals which should be displayed on the date-time axis. The following table demonstrates this feature in action.
DateTimeScaleOptionsBase.WorkTimeOnly = false |
DateTimeScaleOptionsBase.WorkTimeOnly = true |
 |
 |
The following markup shows how to configure work time options.
Xaml |
<dxc:XYDiagram2D.AxisX>
<dxc:AxisX2D>
<dxc:AxisX2D.DateTimeScaleOptions>
<dxc:ManualDateTimeScaleOptions WorkTimeOnly="True"
AutoGrid="False"
MeasureUnit="Hour"
GridAlignment="Hour">
<dxc:ManualDateTimeScaleOptions.WorkTimeRules>
<dxc:WorkTimeRule Weekdays="Monday,Tuesday,Wednesday,Thursday,Friday">
<dxc:WorkTimeRule.WorkIntervals>
<dxc:TimeInterval StartHour="09"
StartMinute="00"
StartSecond="00"
EndHour="18"
EndMinute="00"
EndSecond="00"/>
</dxc:WorkTimeRule.WorkIntervals>
</dxc:WorkTimeRule>
<dxc:WorkTimeRule Date="02/02/17">
<dxc:WorkTimeRule.WorkIntervals>
<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>
|
Note
For weekdays whose work time rules are not specified (e.g., Saturday and Sunday in the code above), the whole day (00:00 AM - 12:00 PM) is considered as work time.
The markup above uses the following classes and properties to specify work time.