pub struct Legend {
pub text_style: TextStyle,
pub background_alpha: f32,
pub position: Corner,
/* private fields */
}Expand description
The configuration for a plot legend.
Fields§
§text_style: TextStyle§background_alpha: f32§position: CornerImplementations§
Source§impl Legend
impl Legend
Sourcepub fn text_style(self, style: TextStyle) -> Self
pub fn text_style(self, style: TextStyle) -> Self
Which text style to use for the legend. Default: TextStyle::Body.
Sourcepub fn background_alpha(self, alpha: f32) -> Self
pub fn background_alpha(self, alpha: f32) -> Self
The alpha of the legend background. Default: 0.75.
Sourcepub fn position(self, corner: Corner) -> Self
pub fn position(self, corner: Corner) -> Self
In which corner to place the legend. Default: Corner::RightTop.
Specifies hidden items in the legend configuration to override the existing ones. This allows the legend traces’ visibility to be controlled from the application code.
Sourcepub fn follow_insertion_order(self, follow: bool) -> Self
pub fn follow_insertion_order(self, follow: bool) -> Self
Specifies if the legend item order should be the inserted order.
Default: false.
If true, the order of the legend items will be the same as the order as they were added.
By default it will be sorted alphabetically.
Sourcepub fn color_conflict_handling(
self,
color_conflict_handling: ColorConflictHandling,
) -> Self
pub fn color_conflict_handling( self, color_conflict_handling: ColorConflictHandling, ) -> Self
Specifies how to handle conflicting colors for an item.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Legend
impl<'de> Deserialize<'de> for Legend
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Legend
Auto Trait Implementations§
impl Freeze for Legend
impl RefUnwindSafe for Legend
impl Send for Legend
impl Sync for Legend
impl Unpin for Legend
impl UnwindSafe for Legend
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