[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [Collapse]Chart Control
   [Expand]Getting Started
   [Expand]Charting Basics
   [Expand]Series Views
   [Expand]Chart Elements
   [Expand]Providing Data
   [Collapse]Data Representation
     Filter Series Data
     Sorting Data
     Data Aggregation
     Calculating Summaries
    [Expand]Financial Charting
     Using The Top-N Feature
     Work Time and Workday Configuration
     Empty Points
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Additional Resources
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Work Time and Workday Configuration

This document explains how to exclude non-working days and time from the date-time X-axis scale.

Expanded Exclude Non-Working Days

Use Workdays Options to exclude non-working days or add strict workdays.

Axis.DateTimeScaleOptions.WorkdaysOnly = false Axis.DateTimeScaleOptions.WorkdaysOnly = true

The following code demonstrates how to configure workdays options.

The below members and classes are used in the code above.

Class or Member Description
DateTimeScaleOptions.WorkdaysOnly Specifies whether holidays and non-working days should be excluded from the axis scale.
DateTimeScaleOptions.WorkdaysOptions Specifies information about non-working days.
WorkdaysOptions.Workdays Specifies which days of the week are workdays.
WorkdaysOptions.Holidays Specifies holiday dates for excluding them from the date-time scale.
WorkdaysOptions.ExactWorkdays Specifies strict workday dates for including them to the date-time scale.
KnownDate A particular named date.

Note that holidays can be imported from the DevExpress Scheduler (.xml) or Microsoft Office Outlook® (.hol) file, using the Load Holidays button, at design time, or using the WorkdaysOptions.LoadHolidays method at runtime.

Expanded Exclude Non-Working Time

Work Time Rules allows you to specify time intervals which should be displayed on the axis. The following table demonstrates this feature in action.

Axis.DateTimeScaleOptions.WorkTimeOnly = false Axis.DateTimeScaleOptions.WorkTimeOnly = true

The following code demonstrates how to configure work time rules.


Note that 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 taken as work time.

To exclude whole days, use Workdays properties.

The code below uses the following classes and methods.

Class or Member Description
DateTimeScaleOptions.WorkTimeOnly Specifies the value indicating whether to show only the working time on a date-time axis.
DateTimeScaleOptions.WorkTimeRules Specifies a collection of work time rules which should be applied to the date-time axis scale.
WorkTimeRule A work time rule.
WorkTimeRule.WorkIntervals Specifies working intervals within a day.
TimeInterval A time interval.
WorkTimeRule.Weekdays Specifies weekdays on which the rule should be applied.
WorkTimeRule.Date Specifies the date on which the rule should be applied.

Expanded See Also

Is this topic helpful?​​​​​​​