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.WorkDates Property

Specifies dates that DxChart treats as workdays.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public object[] WorkDates { get; set; }

#Property Value

Type Description
Object[]

An array of objects.

#Remarks

Enable the WorkdaysOnly option to display workdays only on the argument axis. Use the WorkDates property to mark select weekend dates as workdays and add them to the argument list.

To specify which days of the week are workdays, use the WorkWeek 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