[][src]Struct vega_lite_4::LegendBuilder

pub struct LegendBuilder { /* fields omitted */ }

Builder for Legend.

Implementations

impl LegendBuilder[src]

pub fn aria<VALUE: Into<Aria>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn clip_height<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn column_padding<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn columns<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn corner_radius<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn description<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn direction<VALUE: Into<Orientation>>(&mut self, value: VALUE) -> &mut Self[src]

The direction of the legend, one of "vertical" or "horizontal".

Default value: - For top-/bottom-oriented legends, "horizontal" - For left-/right-oriented legends, "vertical" - For top/bottom-left/right-oriented legends, "horizontal" for gradient legends and "vertical" for symbol legends.

pub fn fill_color<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn format<VALUE: Into<Format>>(&mut self, value: VALUE) -> &mut Self[src]

When used with the default "number" and "time" format type, the text formatting pattern for labels of guides (axes, legends, headers) and text marks.

See the format documentation for more examples.

When used with a custom formatType, this value will be passed as format alongside datum.value to the registered function.

Default value: Derived from numberFormat config for number format and from timeFormat config for time format.

pub fn format_type<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

The format type for labels. One of "number", "time", or a registered custom format type.

Default value: - "time" for temporal fields and ordinal and nominal fields with timeUnit. - "number" for quantitative fields as well as ordinal and nominal fields without timeUnit.

pub fn gradient_length<VALUE: Into<FontSize>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn gradient_opacity<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn gradient_stroke_color<VALUE: Into<Color>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn gradient_stroke_width<VALUE: Into<FontSize>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn gradient_thickness<VALUE: Into<FontSize>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn grid_align<VALUE: Into<GridAlign>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn label_align<VALUE: Into<TitleAlignUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_baseline<VALUE: Into<TextBaseline>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_color<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn label_expr<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

Vega expression for customizing labels.

Note: The label text and value can be assessed via the label and value properties of the legend's backing datum object.

pub fn label_font<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn label_font_size<VALUE: Into<FontSize>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_font_style<VALUE: Into<Color>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_font_weight<VALUE: Into<FontWeightUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_limit<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_offset<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_opacity<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_overlap<VALUE: Into<LabelOverlapUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_padding<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn label_separation<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn legend_x<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn legend_y<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn offset<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn orient<VALUE: Into<LegendOrient>>(&mut self, value: VALUE) -> &mut Self[src]

The orientation of the legend, which determines how the legend is positioned within the scene. One of "left", "right", "top", "bottom", "top-left", "top-right", "bottom-left", "bottom-right", "none".

Default value: "right"

pub fn padding<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn row_padding<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn stroke_color<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn symbol_dash<VALUE: Into<StrokeDashUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_dash_offset<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_fill_color<VALUE: Into<Color>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_limit<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_offset<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_opacity<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_size<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn symbol_stroke_color<VALUE: Into<Color>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_stroke_width<VALUE: Into<FontSize>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn symbol_type<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn tick_count<VALUE: Into<TickCount>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn tick_min_step<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

The minimum desired step between legend ticks, in terms of scale domain values. For example, a value of 1 indicates that ticks should not be less than 1 unit apart. If tickMinStep is specified, the tickCount value will be adjusted, if necessary, to enforce the minimum step value.

Default value: undefined

pub fn title<VALUE: Into<RemovableValue<LegendText>>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

A title for the field. If null, the title will be removed.

Default value: derived from the field's name and transformation function (aggregate, bin and timeUnit). If the field has an aggregate function, the function is displayed as part of the title (e.g., "Sum of Profit"). If the field is binned or has a time unit applied, the applied function is shown in parentheses (e.g., "Profit (binned)", "Transaction Date (year-month)"). Otherwise, the title is simply the field name.

Notes:

  1. You can customize the default field title format by providing the fieldTitle property in the config or fieldTitle function via the compile function's options.

  2. If both field definition's title and axis, header, or legend title are defined, axis/header/legend title will be used.

pub fn title_align<VALUE: Into<TitleAlignUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_anchor<VALUE: Into<TitleAnchorUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_baseline<VALUE: Into<TextBaseline>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_color<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn title_font<VALUE: Into<Color>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn title_font_size<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_font_style<VALUE: Into<Color>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_font_weight<VALUE: Into<FontWeightUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_limit<VALUE: Into<FontSize>>(&mut self, value: VALUE) -> &mut Self[src]

pub fn title_line_height<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_opacity<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_orient<VALUE: Into<TitleOrientUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn title_padding<VALUE: Into<CornerRadiusUnion>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

pub fn legend_type<VALUE: Into<LegendType>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

The type of the legend. Use "symbol" to create a discrete legend and "gradient" for a continuous color gradient.

Default value: "gradient" for non-binned quantitative fields and temporal fields; "symbol" otherwise.

pub fn values<VALUE: Into<Values>>(&mut self, value: VALUE) -> &mut Self[src]

Explicitly set the visible legend values.

pub fn zindex<VALUE: Into<f64>>(&mut self, value: VALUE) -> &mut Self[src]

A non-negative integer indicating the z-index of the legend. If zindex is 0, legend should be drawn behind all chart elements. To put them in front, use zindex = 1.

pub fn build(&self) -> Result<Legend, String>[src]

Builds a new Legend.

Errors

If a required field has not been initialized.

Trait Implementations

impl Clone for LegendBuilder[src]

impl Default for LegendBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.