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§
Sourcefn draw_axis_line<D>(
&self,
start: Point,
end: Point,
style: &LineStyle<C>,
target: &mut D,
) -> ChartResult<()>where
D: DrawTarget<Color = C>,
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 lineend- End point of the axis linestyle- Line style to usetarget- The display target to draw to
Sourcefn draw_tick<D>(
&self,
position: Point,
length: u32,
orientation: AxisOrientation,
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>,
Draw a tick mark
§Arguments
position- Position of the tick marklength- Length of the tick markorientation- Orientation of the axisstyle- Line style to usetarget- The display target to draw to
Sourcefn draw_grid_line<D>(
&self,
start: Point,
end: Point,
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>,
Draw a grid line
§Arguments
start- Start point of the grid lineend- End point of the grid linestyle- Line style to usetarget- The display target to draw to
Sourcefn draw_label<D>(
&self,
text: &str,
position: Point,
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>,
Draw a label
§Arguments
text- The text to drawposition- Position to draw the labeltarget- 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.