AxisRenderer

Trait AxisRenderer 

Source
pub trait AxisRenderer<C: PixelColor> {
    // Required methods
    fn draw_axis_line<D>(
        &self,
        start: Point,
        end: Point,
        style: &LineStyle<C>,
        target: &mut D,
    ) -> ChartResult<()>
       where D: DrawTarget<Color = C>;
    fn draw_tick<D>(
        &self,
        position: Point,
        length: u32,
        orientation: AxisOrientation,
        style: &LineStyle<C>,
        target: &mut D,
    ) -> ChartResult<()>
       where D: DrawTarget<Color = C>;
    fn draw_grid_line<D>(
        &self,
        start: Point,
        end: Point,
        style: &LineStyle<C>,
        target: &mut D,
    ) -> ChartResult<()>
       where D: DrawTarget<Color = C>;
    fn draw_label<D>(
        &self,
        text: &str,
        position: Point,
        target: &mut D,
    ) -> ChartResult<()>
       where D: DrawTarget<Color = C>;
}
Expand description

Trait for rendering axis components

Required Methods§

Source

fn draw_axis_line<D>( &self, start: Point, end: Point, style: &LineStyle<C>, target: &mut D, ) -> ChartResult<()>
where D: DrawTarget<Color = C>,

Draw the main axis line

§Arguments
  • start - Start point of the axis line
  • end - End point of the axis line
  • style - Line style to use
  • target - The display target to draw to
Source

fn draw_tick<D>( &self, position: Point, length: u32, orientation: AxisOrientation, style: &LineStyle<C>, target: &mut D, ) -> ChartResult<()>
where D: DrawTarget<Color = C>,

Draw a tick mark

§Arguments
  • position - Position of the tick mark
  • length - Length of the tick mark
  • orientation - Orientation of the axis
  • style - Line style to use
  • target - The display target to draw to
Source

fn draw_grid_line<D>( &self, start: Point, end: Point, style: &LineStyle<C>, target: &mut D, ) -> ChartResult<()>
where D: DrawTarget<Color = C>,

Draw a grid line

§Arguments
  • start - Start point of the grid line
  • end - End point of the grid line
  • style - Line style to use
  • target - The display target to draw to
Source

fn draw_label<D>( &self, text: &str, position: Point, target: &mut D, ) -> ChartResult<()>
where D: DrawTarget<Color = C>,

Draw a label

§Arguments
  • text - The text to draw
  • position - Position to draw the label
  • target - The display target to draw to

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§