WorkTimeRule.Weekdays Property
Gets or sets weekdays on which the specified working time intervals should be applied.
Namespace: DevExpress.XtraCharts
Assembly: DevExpress.XtraCharts.v24.2.dll
Declaration
Property Value
Type | Description |
---|---|
Weekday | The Weekday enumeration values. |
Available values:
Name | Description |
---|---|
None | Weekday is not specified. |
Sunday | Identifies Sunday. |
Monday | Identifies Monday. |
Tuesday | Identifies Tuesday. |
Wednesday | Identifies Wednesday. |
Thursday | Identifies Thursday. |
Friday | Identifies Friday. |
Saturday | Identifies Saturday. |
Remarks
Note that the WorkTimeRule.Date property value has a higher priority than the WorkTimeRule.Weekdays
property value when specifying a work time rule.
Example
The following code demonstrates how to configure work time rules.
XYDiagram chartDiagram = (XYDiagram)financialChart.Diagram;
DateTimeScaleOptions xAxisScaleOptions = chartDiagram.AxisX.DateTimeScaleOptions;
// This property turns on axis values filtering by rules.
xAxisScaleOptions.WorkTimeOnly = true;
// Create a new instance of the worktime rule which will be used to specify
// the worktime displayed on the X-axis.
WorkTimeRule weekdayRule = new WorkTimeRule();
xAxisScaleOptions.WorkTimeRules.Add(weekdayRule);
// Specify one or more work intervals of this rule.
weekdayRule.WorkIntervals.Add(new TimeInterval(09, 00, 00, 19, 00, 00));
// Add weekdays on which this rule should be applied.
weekdayRule.Weekdays = Weekday.Monday | Weekday.Tuesday | Weekday.Wednesday
| Weekday.Thursday | Weekday.Friday;
WorkTimeRule dateRule = new WorkTimeRule();
xAxisScaleOptions.WorkTimeRules.Add(dateRule);
dateRule.WorkIntervals.Add(new TimeInterval(12, 00, 00, 16, 00, 00));
// Besides Weekdays, you can specify the Date
// on which this rule should be applied.
dateRule.Date = new DateTime(2017, 1, 1);
See Also