# DateTimeAxis

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-controls-charts/struct-datetimeaxis/

**struct** · [`ferroui-controls-charts`](/docs/0.5.0/api/ferroui-controls-charts/) · v0.5.0

```rust
struct DateTimeAxis
```

A date axis whose bounds compare UTC instants and whose ticks follow
calendar boundaries. Dates before the Unix epoch remain valid.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L12)

## Members

- [`TYPE`](#assoc_const-type)
- [`to_ref`](#function-to_ref)
- [`minimum_property`](#function-minimum_property)
- [`maximum_property`](#function-maximum_property)
- [`interval_type_property`](#function-interval_type_property)
- [`label_format_property`](#function-label_format_property)
- [`construct`](#function-construct)
- [`new`](#function-new)
- [`minimum`](#function-minimum)
- [`set_minimum`](#function-set_minimum)
- [`maximum`](#function-maximum)
- [`set_maximum`](#function-set_maximum)
- [`interval_type`](#function-interval_type)
- [`set_interval_type`](#function-set_interval_type)
- [`label_format`](#function-label_format)
- [`set_label_format`](#function-set_label_format)
- [`set_optional_label_format`](#function-set_optional_label_format)
- [`resolve_range`](#function-resolve_range)
- [`resolved_interval`](#function-resolved_interval)
- [`ticks`](#function-ticks)
- [`format_tick`](#function-format_tick)

<a id="assoc_const-type"></a>

### TYPE

```rust
const TYPE: &'static $crate::TypeInfo
```

The runtime type of this class.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L16)

<a id="function-to_ref"></a>

### to_ref

```rust
fn to_ref(self: &Self) -> $crate::Ref<DateTimeAxis>
```

Returns a strong reference to this object.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L16)

<a id="function-minimum_property"></a>

### minimum_property

```rust
fn minimum_property() -> &'static StyledProperty<Option<DateTimeOffset>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L22)

<a id="function-maximum_property"></a>

### maximum_property

```rust
fn maximum_property() -> &'static StyledProperty<Option<DateTimeOffset>>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L22)

<a id="function-interval_type_property"></a>

### interval_type_property

```rust
fn interval_type_property() -> &'static StyledProperty<DateTimeIntervalType>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L22)

<a id="function-label_format_property"></a>

### label_format_property

```rust
fn label_format_property() -> &'static StyledProperty<String>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L22)

<a id="function-construct"></a>

### construct

```rust
fn construct() -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L40)

<a id="function-new"></a>

### new

```rust
fn new() -> Ref<Self>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L46)

<a id="function-minimum"></a>

### minimum

```rust
fn minimum(self: &Self) -> Option<DateTimeOffset>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L50)

<a id="function-set_minimum"></a>

### set_minimum

```rust
fn set_minimum(self: &Self, value: Option<DateTimeOffset>) -> Result<(), ChartError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L54)

<a id="function-maximum"></a>

### maximum

```rust
fn maximum(self: &Self) -> Option<DateTimeOffset>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L60)

<a id="function-set_maximum"></a>

### set_maximum

```rust
fn set_maximum(self: &Self, value: Option<DateTimeOffset>) -> Result<(), ChartError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L64)

<a id="function-interval_type"></a>

### interval_type

```rust
fn interval_type(self: &Self) -> DateTimeIntervalType
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L70)

<a id="function-set_interval_type"></a>

### set_interval_type

```rust
fn set_interval_type(self: &Self, value: DateTimeIntervalType)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L74)

<a id="function-label_format"></a>

### label_format

```rust
fn label_format(self: &Self) -> String
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L78)

<a id="function-set_label_format"></a>

### set_label_format

```rust
fn set_label_format(self: &Self, value: impl Into<String>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L82)

<a id="function-set_optional_label_format"></a>

### set_optional_label_format

```rust
fn set_optional_label_format(self: &Self, value: Option<&str>)
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L86)

<a id="function-resolve_range"></a>

### resolve_range

```rust
fn resolve_range(self: &Self, values: &[DateTimeOffset]) -> (DateTimeOffset, DateTimeOffset)
```

Automatic bounds use the sample instants; an empty source has a
deterministic one-day range beginning at the Unix epoch.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L117)

<a id="function-resolved_interval"></a>

### resolved_interval

```rust
fn resolved_interval(self: &Self, minimum: DateTimeOffset, maximum: DateTimeOffset, target_tick_count: usize) -> DateTimeIntervalType
```

The interval of the ticks between `minimum` and `maximum`: the `IntervalType`, or
for `Auto` the calendar unit that gives about `target_tick_count` ticks.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L155)

<a id="function-ticks"></a>

### ticks

```rust
fn ticks(self: &Self, minimum: DateTimeOffset, maximum: DateTimeOffset, target_tick_count: usize) -> Vec<DateTimeOffset>
```

Calendar-aligned ticks in UTC. Month/year ticks use calendar
arithmetic, so leap days and variable-length months are preserved.
Explicit daily/weekly intervals may be sampled for very large ranges;
no call produces more than 4096 ticks. A daily range with fewer than two
midnights in it is divided into whole minutes or hours instead.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L183)

<a id="function-format_tick"></a>

### format_tick

```rust
fn format_tick(self: &Self, value: DateTimeOffset) -> String
```

Formats an axis label using the framework's culture-aware date
formatter. The public WinRT templates used by the source samples are
translated to their framework format equivalents.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.Controls.Charts/date_time_axis.rs#L287)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- [`Receiver`](/docs/0.5.0/api/ferroui-system/task/oneshot/struct-receiver/)
- `Any`
- [`FerroObjectImplExt`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimplext/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Deref`
- [`Upcast<T>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`Upcast<DateTimeAxis>`](/docs/0.5.0/api/ferroui-base/trait-upcast/)
- [`StaticType`](/docs/0.5.0/api/ferroui-base/trait-statictype/)
- [`ObjectType`](/docs/0.5.0/api/ferroui-base/trait-objecttype/)
- [`Subclassable<T>`](/docs/0.5.0/api/ferroui-base/trait-subclassable/)
- [`DefaultConstructible`](/docs/0.5.0/api/ferroui-base/trait-defaultconstructible/)
- [`FerroObjectImpl`](/docs/0.5.0/api/ferroui-base/trait-ferroobjectimpl/)

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
