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§
Sourcefn draw_with_axis<D, A>(
&self,
viewport: Rectangle,
axis: &A,
target: &mut D,
) -> ChartResult<()>where
D: DrawTarget<Color = C>,
A: Axis<T, C>,
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 inaxis- The axis to align withtarget- The display target to draw to
Sourcefn calculate_tick_positions<A>(
&self,
viewport: Rectangle,
axis: &A,
) -> Vec<i32, 64>where
A: Axis<T, C>,
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 areaaxis- The axis to get ticks from
Sourcefn set_major_ticks_only(&mut self, major_only: bool)
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
Sourcefn is_major_ticks_only(&self) -> bool
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.