The Progress Bar

Excluding Weekends and Holidays in XtraCharts – v2010 vol 2

The Winforms Charting package of the XtraCharts Suite has always provided a comprehensive and advanced solution for visualizing data in your application. When it comes to financial charts, you can select to use OHLC or Candelstick charts to plot your data and then draw the necessary trend lines.

But what happens when you have real market data that excludes weekends and holidays? You end up with gaps in the chart that may look like this:

WinForms Financial Chart - Holidays

As requested in S33880, in the upcoming release of DXperience 2010.2, we have implemented the ability to exclude weekends, holidays as well as any other custom dates that should not be displayed on the chart. This is accomplished using the WorkdaysOnly property of an axis.

When set to ‘True’, weekends are automatically filtered out, and a WorkdaysOptions property collection becomes available for the axis.

XtraCharts - WorkdaysOptions

The ExactWorkdays property allows you to specify days that are treated as workdays, even if they coincide with the holidays defined via the Holidays property, or weekends defined via the Workdays property. In other words, the days defined via the ExactWorkdays property have a priority over other properties settings, and are always represented in the axis range, as working days.

You can use the Workdays property to specify the standard business days within a week. This may come in handy if you are collecting or rendering data from a country where the standard work week might be slightly different.

The Holidays property allows you to specify holidays that should be filtered out. You have the option to manually add dates which should be treated as holidays.

XtraCharts - Custom Holidays

Or, you may import an existing list of holidays in the DevExpress Scheduler (.xml) or Microsoft Office Outlook® (.hol) formats. So for example, if you use the “holidays.xml” file included in the demos installed with DXperience, you will be presented with the following dialog to select which holidays to import:

XtraCharts - Load Holidays

After excluding all the weekends and market holidays, the original chart will look like this:

WinForms Financial Chart - Holidays Excluded

To see a walkthrough of how this accomplished, check out the video on the DevExpress Channel:

Published Aug 02 2010, 09:52 AM by
Bookmark and Share


Mark Bissett 2

Looks good, but I'd question how many people this is will be of use to. Could I not already do this by controlling how I create the dataset which provides the data to the chart in the first place?

I'd prefer to see bigger problems fixed first such as providing end-users a mechanism to edit embedded sub-reports in xtraReports.

August 3, 2010 4:25 AM

Emil Mesropian (DevExpress)

Hi Mark,

This is useful if you are pulling historical financial data from other sources over which you have no control or would take time to modify for your use. Take a trading application for example... it'd be much better to filter out the "view" at runtime than to start messing with the original data. :-)

As for other products, rest assured that the respective teams are working on several improvements and features that will be announced as we near the 2010.2 release.

August 3, 2010 12:25 PM

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at or call us at +1 (818) 844-3383


DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, Delphi, HTML5 or iOS & Android development. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2018 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners