Trait charts::point::ChartRender
source · [−]pub trait ChartRender<X, Y> where
X: CoordExt,
Y: CoordExt,
Self: RangesExt<X, Y> + PointValExt<X> + PointValExt<Y>, {
fn points(&self) -> Iter<'_, Point<X, Y>>;
fn ranges_processor(
ranges: Ranges<Option<X>, Option<Y>>
) -> Res<Ranges<X, Y>> { ... }
fn coord_ranges_processor(
ranges: &Ranges<X, Y>
) -> Res<Ranges<X::Coord, Y::Coord>> { ... }
fn x_coord_processor(x_range: &Range<X>, x: &X) -> X::Coord { ... }
fn y_coord_processor(y_range: &Range<Y>, y: &Y) -> Y::Coord { ... }
fn x_label_formatter(val: &X::Coord) -> String { ... }
fn y_label_formatter(val: &Y::Coord) -> String { ... }
fn render<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()>
where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
{ ... }
fn chart_render<'spec, DB>(
&self,
_settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec>
) -> Res<()>
where
DB: DrawingBackend,
{ ... }
fn chart_render_stacked_area<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()>
where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
{ ... }
fn chart_render_stacked_area_percent<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()>
where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
{ ... }
fn chart_render_stacked_area_custom<'spec, DB, RealY: CoordExt>(
&self,
_settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone,
zero: impl Fn() -> RealY::Coord,
compute_from_val_and_max: impl Fn(Y::Coord, &Y::Coord) -> RealY::Coord,
range_do: impl Fn(Y::Coord, Y::Coord) -> RealY::Range,
label_formatter: impl Fn(&RealY::Coord) -> String,
_type_inference_help: fn() -> RealY
) -> Res<()>
where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
RealY::Coord: Add<RealY::Coord, Output = RealY::Coord> + Display,
{ ... }
}
Expand description
Chart-rendering trait.
Required Methods
Provided Methods
Processes the ranges for both axis.
Turns point-value ranges into coordinate ranges.
fn x_coord_processor(x_range: &Range<X>, x: &X) -> X::Coord
fn x_coord_processor(x_range: &Range<X>, x: &X) -> X::Coord
Processes a x-axis point value to yield a x-axis coordinate.
fn y_coord_processor(y_range: &Range<Y>, y: &Y) -> Y::Coord
fn y_coord_processor(y_range: &Range<Y>, y: &Y) -> Y::Coord
Processes a y-axis point value to yield a y-axis coordinate.
fn x_label_formatter(val: &X::Coord) -> String
fn x_label_formatter(val: &X::Coord) -> String
X-axis label formatter.
fn y_label_formatter(val: &Y::Coord) -> String
fn y_label_formatter(val: &Y::Coord) -> String
Y-axis label formatter.
fn render<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
fn render<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
Renders some points on a graph.
Normal display mode rendering.
fn chart_render_stacked_area<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
fn chart_render_stacked_area<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
Stacked area rendering.
fn chart_render_stacked_area_percent<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
fn chart_render_stacked_area_percent<'spec, DB>(
&self,
settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
Percent stacked area rendering.
fn chart_render_stacked_area_custom<'spec, DB, RealY: CoordExt>(
&self,
_settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone,
zero: impl Fn() -> RealY::Coord,
compute_from_val_and_max: impl Fn(Y::Coord, &Y::Coord) -> RealY::Coord,
range_do: impl Fn(Y::Coord, Y::Coord) -> RealY::Range,
label_formatter: impl Fn(&RealY::Coord) -> String,
_type_inference_help: fn() -> RealY
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
RealY::Coord: Add<RealY::Coord, Output = RealY::Coord> + Display,
fn chart_render_stacked_area_custom<'spec, DB, RealY: CoordExt>(
&self,
_settings: &Chart,
chart_builder: ChartBuilder<'_, '_, DB>,
style_conf: &impl StyleExt,
is_active: impl Fn(Line) -> bool,
active_filters: impl Iterator<Item = &'spec FilterSpec> + Clone,
zero: impl Fn() -> RealY::Coord,
compute_from_val_and_max: impl Fn(Y::Coord, &Y::Coord) -> RealY::Coord,
range_do: impl Fn(Y::Coord, Y::Coord) -> RealY::Range,
label_formatter: impl Fn(&RealY::Coord) -> String,
_type_inference_help: fn() -> RealY
) -> Res<()> where
DB: DrawingBackend,
X: Display,
Y::Coord: RatioExt + Add<Output = Y::Coord> + Sub<Output = Y::Coord> + Clone + Display + PartialOrd + Ord + PartialEq,
RealY::Coord: Add<RealY::Coord, Output = RealY::Coord> + Display,
Stacked area rendering.