Back to Devexpress

ChartAxisInterval.Hours(Int32) Method

blazor-devexpress-dot-blazor-dot-chartaxisinterval-dot-hours-x28-system-dot-int32-x29.md

latest2.2 KB
Original Source

ChartAxisInterval.Hours(Int32) Method

Returns the interval between two ticks of the specified number of hours.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public static ChartAxisInterval Hours(
    int interval
)

Parameters

NameTypeDescription
intervalInt32

The number of hours.

|

Returns

TypeDescription
ChartAxisInterval

A ChartAxisInterval structure object.

|

Remarks

The Chart automatically calculates the interval between major and minor ticks based on the axis values. Use the TickInterval and MinorTickInterval properties to specify custom intervals.

The following example sets the tick interval to 8 hours for major ticks and one hour for minor ticks:

razor
<DxChart Data="@forecasts">
    <DxChartLineSeries ArgumentField="@((WeatherForecast i) => i.Date)"
                       ValueField="@((WeatherForecast i) => i.TemperatureC)"
                       Name="Temperature, C" />
    <DxChartLineSeries ArgumentField="@((WeatherForecast i) => i.Date)"
                       ValueField="@((WeatherForecast i) => i.TemperatureF)"
                       Name="Temperature, F" />
    <DxChartArgumentAxis TickInterval="ChartAxisInterval.Hours(8)" 
                         MinorTickInterval="ChartAxisInterval.Hour">
        <DxChartAxisMinorTick Visible="true" />
    </DxChartArgumentAxis>
</DxChart>

See Also

ChartAxisInterval Struct

ChartAxisInterval Members

DevExpress.Blazor Namespace