pub struct ChartLayout<'a> { /* private fields */ }
Expand description
Specifies layout of chart before creating DrawingArea
Implementations§
Source§impl<'a> ChartLayout<'a>
impl<'a> ChartLayout<'a>
pub fn new() -> Self
pub fn set_all_label_area_size( &mut self, top: u32, bottom: u32, left: u32, right: u32, ) -> &mut Self
pub fn x_label_area_size(&mut self, size: u32) -> &mut Self
pub fn y_label_area_size(&mut self, size: u32) -> &mut Self
pub fn top_x_label_area_size(&mut self, size: u32) -> &mut Self
pub fn right_y_label_area_size(&mut self, size: u32) -> &mut Self
pub fn set_all_margin( &mut self, top: u32, bottom: u32, left: u32, right: u32, ) -> &mut Self
pub fn margin(&mut self, size: u32) -> &mut Self
pub fn margin_top(&mut self, size: u32) -> &mut Self
pub fn margin_bottom(&mut self, size: u32) -> &mut Self
pub fn margin_left(&mut self, size: u32) -> &mut Self
pub fn margin_right(&mut self, size: u32) -> &mut Self
pub fn no_caption(&mut self) -> &mut Self
Sourcepub fn caption(
&mut self,
text: impl Into<String>,
font: impl Into<FontDesc<'a>>,
) -> Result<&mut Self, FontError>
pub fn caption( &mut self, text: impl Into<String>, font: impl Into<FontDesc<'a>>, ) -> Result<&mut Self, FontError>
Sets new caption text and calculates caption area above the chart.
Sourcepub fn replace_caption(&mut self, text: impl Into<String>) -> &mut Self
pub fn replace_caption(&mut self, text: impl Into<String>) -> &mut Self
Replaces caption test, without updating layout.
It is needed to call caption()
in order to make caption visible.
Sourcepub fn desired_image_size(&self, plot_size: (u32, u32)) -> (u32, u32)
pub fn desired_image_size(&self, plot_size: (u32, u32)) -> (u32, u32)
Size of root area whose plotting area will be equal to plot_size
.
An DrawingArea
with returned size should be given for bind()
.
Sourcepub fn desired_image_height_from_width(
&self,
image_width: u32,
aspect_ratio: f64,
) -> u32
pub fn desired_image_height_from_width( &self, image_width: u32, aspect_ratio: f64, ) -> u32
Estimates required root-area height from its width and the aspect ratio of the plotting area.
aspect_ratio
is the ratio of plotting-area height to its width.
Sourcepub fn bind<'b, DB>(
&self,
root_area: &'b DrawingArea<DB, Shift>,
) -> Result<ChartLayoutBuilder<'b, DB>, DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>>where
DB: DrawingBackend,
'a: 'b,
pub fn bind<'b, DB>(
&self,
root_area: &'b DrawingArea<DB, Shift>,
) -> Result<ChartLayoutBuilder<'b, DB>, DrawingAreaErrorKind<<DB as DrawingBackend>::ErrorType>>where
DB: DrawingBackend,
'a: 'b,
Bind layout information to an actual root area.
Trait Implementations§
Source§impl<'a> Clone for ChartLayout<'a>
impl<'a> Clone for ChartLayout<'a>
Source§fn clone(&self) -> ChartLayout<'a>
fn clone(&self) -> ChartLayout<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for ChartLayout<'a>
impl<'a> Debug for ChartLayout<'a>
Auto Trait Implementations§
impl<'a> Freeze for ChartLayout<'a>
impl<'a> !RefUnwindSafe for ChartLayout<'a>
impl<'a> !Send for ChartLayout<'a>
impl<'a> !Sync for ChartLayout<'a>
impl<'a> Unpin for ChartLayout<'a>
impl<'a> !UnwindSafe for ChartLayout<'a>
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