pub struct TickBasedGrid<T, C>{ /* private fields */ }Expand description
Grid that aligns with axis ticks
Implementations§
Source§impl<T, C> TickBasedGrid<T, C>
impl<T, C> TickBasedGrid<T, C>
Sourcepub fn new(orientation: GridOrientation) -> Self
pub fn new(orientation: GridOrientation) -> Self
Create a new tick-based grid
Sourcepub fn horizontal() -> Self
pub fn horizontal() -> Self
Create a horizontal tick-based grid
Sourcepub fn with_style(self, style: GridStyle<C>) -> Self
pub fn with_style(self, style: GridStyle<C>) -> Self
Set the grid style
Sourcepub fn with_major_ticks_only(self, major_only: bool) -> Self
pub fn with_major_ticks_only(self, major_only: bool) -> Self
Set whether to show only major tick grid lines
Sourcepub fn is_major_ticks_only(&self) -> bool
pub fn is_major_ticks_only(&self) -> bool
Check if only major tick grid lines are shown
Sourcepub fn set_major_ticks_only(&mut self, major_only: bool)
pub fn set_major_ticks_only(&mut self, major_only: bool)
Set whether to show grid lines for major ticks only
Trait Implementations§
Source§impl<T, C> Clone for TickBasedGrid<T, C>
impl<T, C> Clone for TickBasedGrid<T, C>
Source§fn clone(&self) -> TickBasedGrid<T, C>
fn clone(&self) -> TickBasedGrid<T, C>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, C> Debug for TickBasedGrid<T, C>
impl<T, C> Debug for TickBasedGrid<T, C>
Source§impl<T, C> Grid<C> for TickBasedGrid<T, C>
impl<T, C> Grid<C> for TickBasedGrid<T, C>
Source§fn draw<D>(&self, viewport: Rectangle, target: &mut D) -> ChartResult<()>where
D: DrawTarget<Color = C>,
fn draw<D>(&self, viewport: Rectangle, target: &mut D) -> ChartResult<()>where
D: DrawTarget<Color = C>,
Draw the grid lines to the target Read more
Source§fn orientation(&self) -> GridOrientation
fn orientation(&self) -> GridOrientation
Get the grid orientation (horizontal or vertical)
Source§fn is_visible(&self) -> bool
fn is_visible(&self) -> bool
Check if the grid is visible
Source§fn set_visible(&mut self, visible: bool)
fn set_visible(&mut self, visible: bool)
Set grid visibility
Source§fn calculate_positions(&self, viewport: Rectangle) -> Vec<i32, 64>
fn calculate_positions(&self, viewport: Rectangle) -> Vec<i32, 64>
Calculate the positions where grid lines should be drawn
Returns a vector of positions in screen coordinates
Source§fn set_spacing(&mut self, _spacing: f32)
fn set_spacing(&mut self, _spacing: f32)
Set the spacing between grid lines
Source§impl<T, C> TickAlignedGrid<T, C> for TickBasedGrid<T, C>where
T: AxisValue + 'static,
C: PixelColor + 'static,
impl<T, C> TickAlignedGrid<T, C> for TickBasedGrid<T, C>where
T: AxisValue + 'static,
C: PixelColor + 'static,
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>,
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 Read more
Source§fn 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 Read more
Source§fn 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 Read more
Source§fn is_major_ticks_only(&self) -> bool
fn is_major_ticks_only(&self) -> bool
Check if only major tick grid lines are shown
Auto Trait Implementations§
impl<T, C> Freeze for TickBasedGrid<T, C>where
C: Freeze,
impl<T, C> RefUnwindSafe for TickBasedGrid<T, C>where
T: RefUnwindSafe,
C: RefUnwindSafe,
impl<T, C> Send for TickBasedGrid<T, C>
impl<T, C> Sync for TickBasedGrid<T, C>
impl<T, C> Unpin for TickBasedGrid<T, C>
impl<T, C> UnwindSafe for TickBasedGrid<T, C>where
T: UnwindSafe,
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.