[][src]Trait charts::Scale

pub trait Scale<T> {
    fn get_type(&self) -> ScaleType;
fn scale(&self, domain: &T) -> f32;
fn bandwidth(&self) -> Option<f32>;
fn range_start(&self) -> f32;
fn range_end(&self) -> f32;
fn get_ticks(&self) -> Vec<T>; fn is_range_reversed(&self) -> bool { ... } }

The Scale trait defines common operations on all scales.

Required methods

fn get_type(&self) -> ScaleType

Get the type of the scale.

fn scale(&self, domain: &T) -> f32

Get the range value for the given domain entry.

fn bandwidth(&self) -> Option<f32>

Get the bandwidth (if present).

fn range_start(&self) -> f32

Get the start range value.

fn range_end(&self) -> f32

Get the end range value.

fn get_ticks(&self) -> Vec<T>

Get the list of ticks that represent the scale on a chart axis.

Loading content...

Provided methods

fn is_range_reversed(&self) -> bool

Check whether the range is in reversed order, meaning the start is greater than the end.

Loading content...

Implementors

impl Scale<f32> for ScaleLinear[src]

fn get_type(&self) -> ScaleType[src]

Get the type of the scale.

fn scale(&self, domain: &f32) -> f32[src]

Get the range value for the given domain entry.

fn bandwidth(&self) -> Option<f32>[src]

Get the bandwidth (if present).

fn range_start(&self) -> f32[src]

Get the start range value.

fn range_end(&self) -> f32[src]

Get the end range value.

fn get_ticks(&self) -> Vec<f32>[src]

Get the list of ticks that represent the scale on a chart axis.

impl Scale<String> for ScaleBand[src]

fn get_type(&self) -> ScaleType[src]

Get the type of the scale.

fn scale(&self, domain: &String) -> f32[src]

Get the range value for the given domain entry.

fn bandwidth(&self) -> Option<f32>[src]

Get the bandwidth (if present).

fn range_start(&self) -> f32[src]

Get the start range value.

fn range_end(&self) -> f32[src]

Get the end range value.

fn get_ticks(&self) -> Vec<String>[src]

Get the list of ticks that represent the scale on a chart axis.

Loading content...