# Labeler

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-livecharts/labelers/struct-labeler/

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

```rust
struct Labeler
```

The label of a value (the source's `Func<double, string>`), shared by the snapshots of an axis.
Two labelers are equal when they are the same function.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/labelers.rs#L13)

## Members

- [`new`](#function-new)
- [`label`](#function-label)
- [`date_time`](#function-date_time)
- [`date_time_format`](#function-date_time_format)
- [`time_span`](#function-time_span)
- [`time_span_format`](#function-time_span_format)

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

### new

```rust
fn new(labeler: impl Fn(f64) -> String + 'static) -> Self
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/labelers.rs#L16)

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

### label

```rust
fn label(self: &Self, value: f64) -> String
```

The label of a value.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/labelers.rs#L20)

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

### date_time

```rust
fn date_time(formatter: impl Fn(DateTime) -> String + 'static) -> Self
```

The labeler of a `DateTimeAxis`: the value as the date of its ticks (`AsDate`), formatted
by `formatter`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/labelers.rs#L25)

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

### date_time_format

```rust
fn date_time_format(format: impl Into<String>) -> Self
```

A date labeler with a .NET date and time format string, in the conventions of the current
culture (`date.ToString(format)`); an invalid format labels nothing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/labelers.rs#L30)

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

### time_span

```rust
fn time_span(formatter: impl Fn(SignedDuration) -> String + 'static) -> Self
```

The labeler of a `TimeSpanAxis`: the value as the interval of its ticks (`AsTimeSpan`),
formatted by `formatter`.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/labelers.rs#L39)

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

### time_span_format

```rust
fn time_span_format(format: impl Into<String>) -> Self
```

An interval labeler with a .NET `TimeSpan` format string (`span.ToString(format)`); an
invalid format labels nothing.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/labelers.rs#L44)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `CloneToUninit`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`
- `ToOwned`
- [`PropertyValue`](/docs/0.5.0/api/ferroui-base/trait-propertyvalue/)
- [`AnyValue`](/docs/0.5.0/api/ferroui-base/trait-anyvalue/)
- [`ClassDefaults`](/docs/0.5.0/api/ferroui-base/trait-classdefaults/)
- `ErasedDestructor`
- `IntoEither`
- `Clone`
- `PartialEq`
- `Debug`

## Availability

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