property Chart.NonworkingDays as Long
Retrieves or sets a value that indicates the non-working days, for each week day a bit.

TypeDescription
Long A long expression that indicates the non-working days in a week.
By default, the NonworkingDays property is 65 ( Saturday(s) and Sunday(s) ). The non-working days are shown using the NonworkingDaysPattern and the NonworkingDaysColor which defines the pattern and the color, when the base level of the chart displays days, if the ShowNonworkingUnits property is True ( by default ).  Use the ShowNonworkingUnits property to display or hide the non-working units as hours or days in your chart. Use the NonworkingHours property to indicate non-working hours in a day.

You can select the non-working week days in the following table ( In Internet Explorer, you have to allow running the script on this page ).

Saturday Friday Thursday Wednesday Tuesday Monday Sunday
Value 64 32 16 8 4 2 1
Bit

Click the Bit row for non-working days and the value for property is: , (hexa), (octal), (binary)

 

The last significant byte in the NonworkingDays expression has the following meaning:

where X could be 1 ( nonworking day ) or 0 ( working day ), Sa means Saturday, Fr means Friday, and so on. For instance, the 65 value means Saturday and Sunday are non-working days. Use the AddNonworkingDate method to add custom dates as being nonworking dates.

Use the ShowNonworkingDates property to show or hide the nonworking dates in the control's chart area. Use the NonworkingDaysPattern property to specify the pattern being used to fill non-working days. The NonworkingDaysColor property specifies the color being used to fill the non-working days. For instance, if  the NonworkingDaysPattern is exPatternEmpty the non-working days are not highlighted. Use the MarkTodayColor property to specify the color to mark the today date. Use the DrawGridLines property to specify whether the control draws the grid lines in the chart's area. Use the GridLineColor property to specify the color for grid lines. Use the DrawGridLines property to specify whether the control draws the grid lines in the items area. Use the DrawGridLines property to draw grid lines for a specified level. Use the Add("A:B") to add a bar that displays the bar A in the working area, and B in non-working areas.

The following VB sample retrieves the value to indicate Sunday and Monday as being non-working days:

With Gantt1.Chart
    .NonworkingDays = 2 ^ (EXGANTTLibCtl.exSunday) Or 2 ^ (EXGANTTLibCtl.exMonday)
End With

The following C++ sample retrieves the value to indicate Sunday and Monday as being non-working days:

m_gantt.GetChart().SetNonworkingDays( 1 << ( EXGANTTLib::exSunday ) | 1 << ( EXGANTTLib::exMonday ) );

where the #import <exgantt.dll> must be called to insert definitions for types in the control's type library.

The following VB.NET sample retrieves the value to indicate Sunday and Monday as being non-working days:

With AxGantt1.Chart
    .NonworkingDays = 2 ^ (EXGANTTLib.WeekDayEnum.exSunday) Or 2 ^ (EXGANTTLib.WeekDayEnum.exMonday)
End With

The following C# sample retrieves the value to indicate Sunday and Monday as being non-working days:

axGantt1.Chart.NonworkingDays = 1 << (Convert.ToInt32(EXGANTTLib.WeekDayEnum.exSunday) ) | 1 << (Convert.ToInt32(EXGANTTLib.WeekDayEnum.exMonday));

The following VFP sample retrieves the value to indicate Sunday and Monday as being non-working days:

with thisform.Gantt1.Chart
	.NonworkingDays = 2 ^ 0 + 2 ^ 1
endwith