pub struct StandardLegendBuilder<C: PixelColor> { /* private fields */ }Expand description
Builder for standard legends
Implementations§
Source§impl<C> StandardLegendBuilder<C>
impl<C> StandardLegendBuilder<C>
Sourcepub fn position(self, position: LegendPosition) -> Self
pub fn position(self, position: LegendPosition) -> Self
Set the legend position
Sourcepub fn orientation(self, orientation: LegendOrientation) -> Self
pub fn orientation(self, orientation: LegendOrientation) -> Self
Set the legend orientation
Sourcepub fn style(self, style: LegendStyle<C>) -> Self
pub fn style(self, style: LegendStyle<C>) -> Self
Set the legend style
Sourcepub fn minimal_style(self) -> Self
pub fn minimal_style(self) -> Self
Use minimal styling for small displays
Sourcepub fn professional_style(self) -> Self
pub fn professional_style(self) -> Self
Use professional styling
Sourcepub fn compact_style(self) -> Self
pub fn compact_style(self) -> Self
Use compact styling
Sourcepub fn alignment(self, alignment: LegendAlignment) -> Self
pub fn alignment(self, alignment: LegendAlignment) -> Self
Set the legend alignment
Sourcepub fn margins(self, margins: LegendMargins) -> Self
pub fn margins(self, margins: LegendMargins) -> Self
Set the legend margins
Sourcepub fn add_line_entry(self, label: &str, color: C) -> ChartResult<Self>
pub fn add_line_entry(self, label: &str, color: C) -> ChartResult<Self>
Add a line entry to the legend
Sourcepub fn add_line_entry_with_marker(
self,
label: &str,
color: C,
marker: MarkerStyle<C>,
) -> ChartResult<Self>
pub fn add_line_entry_with_marker( self, label: &str, color: C, marker: MarkerStyle<C>, ) -> ChartResult<Self>
Add a line entry with marker to the legend
Sourcepub fn add_bar_entry(self, label: &str, color: C) -> ChartResult<Self>
pub fn add_bar_entry(self, label: &str, color: C) -> ChartResult<Self>
Add a bar entry to the legend
Sourcepub fn add_bar_entry_with_border(
self,
label: &str,
color: C,
border_color: C,
border_width: u32,
) -> ChartResult<Self>
pub fn add_bar_entry_with_border( self, label: &str, color: C, border_color: C, border_width: u32, ) -> ChartResult<Self>
Add a bar entry with border to the legend
Sourcepub fn add_pie_entry(self, label: &str, color: C) -> ChartResult<Self>
pub fn add_pie_entry(self, label: &str, color: C) -> ChartResult<Self>
Add a pie entry to the legend
Sourcepub fn add_custom_entry(
self,
label: &str,
color: C,
shape: SymbolShape,
size: u32,
) -> ChartResult<Self>
pub fn add_custom_entry( self, label: &str, color: C, shape: SymbolShape, size: u32, ) -> ChartResult<Self>
Add a custom symbol entry to the legend
Sourcepub fn add_entry(
self,
label: &str,
entry_type: LegendEntryType<C>,
) -> ChartResult<Self>
pub fn add_entry( self, label: &str, entry_type: LegendEntryType<C>, ) -> ChartResult<Self>
Add a generic entry to the legend
Sourcepub fn clear_entries(self) -> Self
pub fn clear_entries(self) -> Self
Clear all entries
Trait Implementations§
Source§impl<C: Debug + PixelColor> Debug for StandardLegendBuilder<C>
impl<C: Debug + PixelColor> Debug for StandardLegendBuilder<C>
Source§impl<C> Default for StandardLegendBuilder<C>
impl<C> Default for StandardLegendBuilder<C>
Source§impl<C> LegendBuilder<C> for StandardLegendBuilder<C>
impl<C> LegendBuilder<C> for StandardLegendBuilder<C>
Auto Trait Implementations§
impl<C> Freeze for StandardLegendBuilder<C>where
C: Freeze,
impl<C> RefUnwindSafe for StandardLegendBuilder<C>where
C: RefUnwindSafe,
impl<C> Send for StandardLegendBuilder<C>where
C: Send,
impl<C> Sync for StandardLegendBuilder<C>where
C: Sync,
impl<C> Unpin for StandardLegendBuilder<C>where
C: Unpin,
impl<C> UnwindSafe for StandardLegendBuilder<C>where
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> 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.