[][src]Struct vega_lite_3::HeaderBuilder

pub struct HeaderBuilder { /* fields omitted */ }

Builder for Header.

Methods

impl HeaderBuilder[src]

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

The text formatting pattern for labels of guides (axes, legends, headers) and text marks.

See the format documentation for more examples.

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

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

The format type for labels ("number" or "time").

Default value:

  • "time" for temporal fields and ordinal and nomimal fields with timeUnit.
  • "number" for quantitative fields as well as ordinal and nomimal fields without timeUnit.

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

Horizontal text alignment of header labels.

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

The anchor position for placing the labels. One of "start", "middle", or "end". For example, with a label orientation of top these anchor positions map to a left-, center-, or right-aligned label.

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

The rotation angle of the header labels.

Default value: 0 for column header, -90 for row header.

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

The color of the header label, can be in hex color code or regular color name.

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

The font of the header label.

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

The font size of the header label, in pixels.

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

The font style of the header label.

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

The maximum length of the header label in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.

Default value: 0, indicating no limit

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

The orientation of the header label. One of "top", "bottom", "left" or "right".

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

The padding, in pixel, between facet header's label and the plot.

Default value: 10

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

A boolean flag indicating if labels should be included as part of the header.

Default value: true.

pub fn title<VALUE: Into<RemovableValue<String>>>(
    &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<Align>>(&mut self, value: VALUE) -> &mut Self[src]

Horizontal text alignment (to the anchor) of header titles.

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

The anchor position for placing the title. One of "start", "middle", or "end". For example, with an orientation of top these anchor positions map to a left-, center-, or right-aligned title.

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

The rotation angle of the header title.

Default value: 0.

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

Vertical text baseline for the header title. One of "top", "bottom", "middle".

Default value: "middle"

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

Color of the header title, can be in hex color code or regular color name.

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

Font of the header title. (e.g., "Helvetica Neue").

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

Font size of the header title.

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

The font style of the header title.

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

Font weight of the header title. This can be either a string (e.g "bold", "normal") or a number (100, 200, 300, ..., 900 where "normal" = 400 and "bold" = 700).

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

The maximum length of the header title in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.

Default value: 0, indicating no limit

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

The orientation of the header title. One of "top", "bottom", "left" or "right".

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

The padding, in pixel, between facet header's title and the label.

Default value: 10

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

Builds a new Header.

Errors

If a required field has not been initialized.

Trait Implementations

impl Clone for HeaderBuilder[src]

impl Default for HeaderBuilder[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.