[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Collapse]Chart Control
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Collapse]Creating Charts
     [Expand]2D Chart Types
     [Expand]3D Chart Types
     [Expand]Providing Data
     [Collapse]Data Representation
       Filtering Data
       Sorting Data
       Calculating Summaries
       Using The Top-N Feature
       Data Aggregation
       Workday and Holiday Exclusion
       Empty Points Representation
     [Expand]Appearance Customization
     [Expand]Miscellaneous
    [Expand]Chart Elements
    [Expand]End-User Interaction
     Supported Browsers
     Adding a Web Chart
     Handling Client-side Scripts
     Medium Trust Support
     Web Farm and Web Gardens Support
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[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]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Workday and Holiday Exclusion

When using the date-time argument scale type, it is often necessary to exclude non-working days from the X-axis scale. This can easily be done via the DateTimeScaleOptions.WorkdaysOnly property, as illustrated in the following image.

Axis.DateTimeScaleOptions.WorkdaysOnly = false

Axis.DateTimeScaleOptions.WorkdaysOnly = true

When this property is enabled, the DateTimeScaleOptions.WorkdaysOptions property becomes available. It provides the following options.

  • The WorkdaysOptions.Workdays property allows you to select which days of the week are treated as work days.

  • The WorkdaysOptions.Holidays property allows you to modify the collection of holidays, each represented by a KnownDate object that stores the holiday name and date.

    Instead of specifying holidays manually, you can import them in DevExpress Scheduler (.xml) or Microsoft Office Outlook® (.hol) formats from a file, using the Load Holidays button.

    The following image shows the Imported Holidays dialog, where you can choose cultures for holidays you wish to load from an .xml file.

    At runtime, you can load the file via the WorkdaysOptions.LoadHolidays method, which has an overload allowing you to specify the culture, if required.

  • The WorkdaysOptions.ExactWorkdays property allows you to specify work days that do not depend on the WorkdaysOptions.Workdays and WorkdaysOptions.Holidays properties. For example, when a date is present in the WorkdaysOptions.ExactWorkdays collection, it is always treated as work day, even if it coincides with a weekend or holiday specified in another property.

Expanded See Also

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