Struct vega_lite::Header

source ·
pub struct Header {
Show 15 fields pub format: Option<String>, pub label_angle: Option<f64>, pub label_color: Option<String>, pub label_font: Option<String>, pub label_font_size: Option<f64>, pub label_limit: Option<f64>, pub title: Option<String>, pub title_anchor: Option<String>, pub title_angle: Option<f64>, pub title_baseline: Option<TextBaseline>, pub title_color: Option<String>, pub title_font: Option<String>, pub title_font_size: Option<f64>, pub title_font_weight: Option<FontWeight>, pub title_limit: Option<f64>,
}
Expand description

An object defining properties of a facet’s header.

Headers of row / column channels for faceted plots.

Fields§

§format: Option<String>

The formatting pattern for labels. This is D3’s number format pattern for quantitative fields and D3’s time format pattern for time field.

See the format documentation for more information.

Default value: derived from numberFormat config for quantitative fields and from timeFormat config for temporal fields.

§label_angle: Option<f64>

The rotation angle of the header labels.

Default value: 0.

§label_color: Option<String>

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

§label_font: Option<String>

The font of the header label.

§label_font_size: Option<f64>

The font size of the header label, in pixels.

§label_limit: Option<f64>

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

§title: Option<String>

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.

§title_anchor: Option<String>

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.

Default value: "middle" for single and layered views. "start" for other composite views.

Note: For now, anchor is only customizable only for single and layered views. For other composite views, anchor is always "start".

§title_angle: Option<f64>

The rotation angle of the header title.

Default value: 0.

§title_baseline: Option<TextBaseline>

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

Default value: "middle"

§title_color: Option<String>

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

§title_font: Option<String>

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

§title_font_size: Option<f64>

Font size of the header title.

§title_font_weight: Option<FontWeight>

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).

§title_limit: Option<f64>

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

Trait Implementations§

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.