Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxChartArgumentAxis.WorkWeek Property

Specifies week days that DxChart treats as workdays.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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.

razor
<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