Skip to main content
All docs
V24.1

DxChartArgumentAxis.WorkWeek Property

Specifies week days that DxChart treats as workdays.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[Parameter]
public int[] WorkWeek { get; set; }

Property Value

Type Description
Int32[]

An array of numbers from 0(Sunday) to 6(Saturday).

Remarks

Use the WorkWeek property to define week days that the chart component treats as workdays. Assign an array of numbers from 0(Sunday) to 6(Saturday).

To display only work days on the argument axis, set the WorkdaysOnly property to true.

The Chart component also allows you to mark select weekend dates as workdays (the WorkDates property) or workdays as holidays (the Holidays property).

The following example demonstrates a scenario where a business workweek includes only three days – Monday, Tuesday, and Wednesday. It also marks a weekend date as a workday and a work week date as a holiday.

<DxChart Data="@stockData">
    <DxChartLegend Position="RelativePosition.Outside" />
    <DxChartStockSeries OpenField="(StockDataPoint sdp) => sdp.Open"
                        HighField="sdp => sdp.High"
                        LowField="sdp => sdp.Low"
                        CloseField="sdp => sdp.Close"
                        ArgumentField="@(sdp => new DateTime(
                                        sdp.DateTimeStamp.Year,
                                        sdp.DateTimeStamp.Month,
                                        sdp.DateTimeStamp.Day,
                                        sdp.DateTimeStamp.Hour,
                                        sdp.DateTimeStamp.Minute,
                                        0) )"
                        Name="Eco Supreme" />
    <DxChartArgumentAxis WorkdaysOnly="showWorkdays"
                         TickInterval="ChartAxisInterval.Days(1)"
                         WorkWeek="@(new int[]{1, 2, 3})"
                         WorkDates="@(new object[]{new DateTime(2024, 1, 12)})"
                         Holidays="@(new object[]{new DateTime(2024, 1, 9)})" />
    @* ... *@
</DxChart>

@code {
    IEnumerable<StockDataPoint> stockData;
    bool showWorkdays = true;
    // ...
}

Chart - Workdays on axis

See Also