TickAlignedGrid

Trait TickAlignedGrid 

Source
pub trait TickAlignedGrid<T, C>: Grid<C>
where T: AxisValue, C: PixelColor,
{ // Required methods fn draw_with_axis<D, A>( &self, viewport: Rectangle, axis: &A, target: &mut D, ) -> ChartResult<()> where D: DrawTarget<Color = C>, A: Axis<T, C>; fn calculate_tick_positions<A>( &self, viewport: Rectangle, axis: &A, ) -> Vec<i32, 64> where A: Axis<T, C>; fn set_major_ticks_only(&mut self, major_only: bool); fn is_major_ticks_only(&self) -> bool; }
Expand description

Trait for grids that align with axis ticks

Required Methods§

Source

fn draw_with_axis<D, A>( &self, viewport: Rectangle, axis: &A, target: &mut D, ) -> ChartResult<()>
where D: DrawTarget<Color = C>, A: Axis<T, C>,

Draw grid lines aligned with axis ticks

§Arguments
  • viewport - The area to draw the grid in
  • axis - The axis to align with
  • target - The display target to draw to
Source

fn calculate_tick_positions<A>( &self, viewport: Rectangle, axis: &A, ) -> Vec<i32, 64>
where A: Axis<T, C>,

Calculate grid positions based on axis ticks

§Arguments
  • viewport - The viewport area
  • axis - The axis to get ticks from
Source

fn set_major_ticks_only(&mut self, major_only: bool)

Set whether to show grid lines for major ticks only

§Arguments
  • major_only - If true, only show grid lines for major ticks
Source

fn is_major_ticks_only(&self) -> bool

Check if only major tick grid lines are shown

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§

Source§

impl<T, C> TickAlignedGrid<T, C> for TickBasedGrid<T, C>
where T: AxisValue + 'static, C: PixelColor + 'static,