# Scaler

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-livecharts/measure/struct-scaler/

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

```rust
struct Scaler
```

The source affine scaler, with an optional logarithmic value transform.

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

## Members

- [`new`](#function-new)
- [`with_min_step`](#function-with_min_step)
- [`logarithmic`](#function-logarithmic)
- [`is_linear`](#function-is_linear)
- [`to_pixels`](#function-to_pixels)
- [`to_chart_values`](#function-to_chart_values)
- [`measure_in_pixels`](#function-measure_in_pixels)

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

### new

```rust
fn new(pixel_start: f64, pixel_size: f64, min: f64, max: f64, orientation: AxisOrientation, inverted: bool) -> Result<Self, ScaleError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/measure/scaler.rs#L45)

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

### with_min_step

```rust
fn with_min_step(pixel_start: f64, pixel_size: f64, min: f64, max: f64, orientation: AxisOrientation, inverted: bool, min_step: f64) -> Result<Self, ScaleError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/measure/scaler.rs#L64)

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

### logarithmic

```rust
fn logarithmic(pixel_start: f64, pixel_size: f64, min: f64, max: f64, orientation: AxisOrientation, inverted: bool, base: f64) -> Result<Self, ScaleError>
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/measure/scaler.rs#L101)

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

### is_linear

```rust
fn is_linear(self: Self) -> bool
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/measure/scaler.rs#L125)

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

### to_pixels

```rust
fn to_pixels(self: Self, value: f64) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/measure/scaler.rs#L128)

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

### to_chart_values

```rust
fn to_chart_values(self: Self, pixels: f64) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/measure/scaler.rs#L132)

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

### measure_in_pixels

```rust
fn measure_in_pixels(self: Self, value: f64) -> f64
```



[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.LiveCharts/measure/scaler.rs#L136)

## 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`
- `Copy`
- `Debug`
- `StructuralPartialEq`
- `PartialEq`

## Availability

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