Struct Legend

Source
pub struct Legend<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> Legend<'a>

Source

pub fn bgcolor(&mut self, bgcolor: &'a str) -> &mut Self

Sets the legend background color. Defaults to layout.paper_bgcolor.

Source

pub fn bordercolor(&mut self, bordercolor: &'a str) -> &mut Self

Sets the color of the border enclosing the legend.

default: #444

Source

pub fn borderwidth(&mut self, borderwidth: f64) -> &mut Self

Sets the width (in px) of the border enclosing the legend.

default: 0

Source

pub fn font(&mut self) -> &mut Font<'a>

Sets the font used to text the legend items.

Source

pub fn orientation(&mut self, orientation: Orientation) -> &mut Self

Sets the orientation of the legend.

default: v

Source

pub fn traceorder(&mut self) -> &mut Traceorder

Determines the order at which the legend items are displayed. If normal, the items are displayed top-to-bottom in the same order as the input data. If reversed, the items are displayed in the opposite order as normal. If grouped, the items are displayed in groups (when a trace legendgroup is provided). if grouped+reversed, the items are displayed in the opposite order as grouped.

Source

pub fn tracegroupgap(&mut self, tracegroupgap: f64) -> &mut Self

Sets the amount of vertical space (in px) between legend groups.

default: 10

Source

pub fn itemsizing(&mut self, itemsizing: Itemsizing) -> &mut Self

Determines if the legend items symbols scale with their corresponding trace attributes or remain constant independent of the symbol size on the graph.

default: trace

Source

pub fn itemclick(&mut self, itemclick: Itemclick) -> &mut Self

Determines the behavior on legend item click. toggle toggles the visibility of the item clicked on the graph. toggleothers makes the clicked item the sole visible item on the graph. false disable legend item click interactions.

default: toggle

Source

pub fn itemdoubleclick(&mut self, itemdoubleclick: Itemdoubleclick) -> &mut Self

Determines the behavior on legend item double-click. toggle toggles the visibility of the item clicked on the graph. toggleothers makes the clicked item the sole visible item on the graph. false disable legend item double-click interactions.

default: toggleothers

Source

pub fn x(&mut self, x: f64) -> &mut Self

Sets the x position (in normalized coordinates) of the legend. Defaults to 1.02 for vertical legends and defaults to 0 for horizontal legends.

Source

pub fn xanchor(&mut self, xanchor: Xanchor) -> &mut Self

Sets the legend’s horizontal position anchor. This anchor binds the x position to the left, center or right of the legend. Value auto anchors legends to the right for x values greater than or equal to 2/3, anchors legends to the left for x values less than or equal to 1/3 and anchors legends with respect to their center otherwise.

default: left

Source

pub fn y(&mut self, y: f64) -> &mut Self

Sets the y position (in normalized coordinates) of the legend. Defaults to 1 for vertical legends, defaults to -0.1 for horizontal legends on graphs w/o range sliders and defaults to 1.1 for horizontal legends on graph with one or multiple range sliders.

Source

pub fn yanchor(&mut self, yanchor: Yanchor) -> &mut Self

Sets the legend’s vertical position anchor This anchor binds the y position to the top, middle or bottom of the legend. Value auto anchors legends at their bottom for y values less than or equal to 1/3, anchors legends to at their top for y values greater than or equal to 2/3 and anchors legends with respect to their middle otherwise.

Source

pub fn uirevision(&mut self, uirevision: Any) -> &mut Self

Controls persistence of legend-driven changes in trace and pie label visibility. Defaults to layout.uirevision.

Source

pub fn valign(&mut self, valign: Valign) -> &mut Self

Sets the vertical alignment of the symbols with respect to their associated text.

default: middle

Source

pub fn title(&mut self) -> &mut Title<'a>

Trait Implementations§

Source§

impl<'a> Default for Legend<'a>

Source§

fn default() -> Legend<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Serialize for Legend<'a>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Legend<'a>

§

impl<'a> RefUnwindSafe for Legend<'a>

§

impl<'a> Send for Legend<'a>

§

impl<'a> Sync for Legend<'a>

§

impl<'a> Unpin for Legend<'a>

§

impl<'a> UnwindSafe for Legend<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.