DxChartArgumentAxis.WorkdaysOnly Property
Specifies whether the chart displays only workdays on the axis.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(false)]
[Parameter]
public bool WorkdaysOnly { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Boolean | false |
|
Remarks
Set the WordaysOnly
property to true
to display only workdays on the argument axis. You can use the following properties to specify which days the chart displays as workdays or holidays:
- WorkWeek
- Specifies week days that DxChart treats as workdays.
- WorkDates
- Specifies dates that DxChart treats as workdays.
- Holidays
- Specifies dates that DxChart marks as holidays.
Note
The WorkdaysOnly
property value applies when the DxChartArgumentAxis.ArgumentType property value is DateTime
.
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;
// ...
}