[][src]Struct vega_lite_3::LegendConfig

pub struct LegendConfig {
    pub clip_height: Option<f64>,
    pub column_padding: Option<f64>,
    pub columns: Option<f64>,
    pub corner_radius: Option<f64>,
    pub fill_color: Option<String>,
    pub gradient_direction: Option<Orientation>,
    pub gradient_horizontal_max_length: Option<f64>,
    pub gradient_horizontal_min_length: Option<f64>,
    pub gradient_label_limit: Option<f64>,
    pub gradient_label_offset: Option<f64>,
    pub gradient_length: Option<f64>,
    pub gradient_opacity: Option<f64>,
    pub gradient_stroke_color: Option<String>,
    pub gradient_stroke_width: Option<f64>,
    pub gradient_thickness: Option<f64>,
    pub gradient_vertical_max_length: Option<f64>,
    pub gradient_vertical_min_length: Option<f64>,
    pub grid_align: Option<LayoutAlign>,
    pub label_align: Option<Align>,
    pub label_baseline: Option<TextBaseline>,
    pub label_color: Option<String>,
    pub label_font: Option<String>,
    pub label_font_size: Option<f64>,
    pub label_font_style: Option<String>,
    pub label_font_weight: Option<FontWeight>,
    pub label_limit: Option<f64>,
    pub label_offset: Option<f64>,
    pub label_opacity: Option<f64>,
    pub label_overlap: Option<LabelOverlap>,
    pub label_padding: Option<f64>,
    pub label_separation: Option<f64>,
    pub layout: Option<LegendLayout>,
    pub legend_x: Option<f64>,
    pub legend_y: Option<f64>,
    pub offset: Option<f64>,
    pub orient: Option<LegendOrient>,
    pub padding: Option<f64>,
    pub row_padding: Option<f64>,
    pub short_time_labels: Option<bool>,
    pub stroke_color: Option<String>,
    pub stroke_dash: Option<Vec<f64>>,
    pub stroke_width: Option<f64>,
    pub symbol_base_fill_color: Option<String>,
    pub symbol_base_stroke_color: Option<String>,
    pub symbol_dash: Option<Vec<f64>>,
    pub symbol_dash_offset: Option<f64>,
    pub symbol_direction: Option<Orientation>,
    pub symbol_fill_color: Option<String>,
    pub symbol_offset: Option<f64>,
    pub symbol_opacity: Option<f64>,
    pub symbol_size: Option<f64>,
    pub symbol_stroke_color: Option<String>,
    pub symbol_stroke_width: Option<f64>,
    pub symbol_type: Option<String>,
    pub title: RemovableValue<Value>,
    pub title_align: Option<Align>,
    pub title_anchor: Option<TitleAnchor>,
    pub title_baseline: Option<TextBaseline>,
    pub title_color: Option<String>,
    pub title_font: Option<String>,
    pub title_font_size: Option<f64>,
    pub title_font_style: Option<String>,
    pub title_font_weight: Option<FontWeight>,
    pub title_limit: Option<f64>,
    pub title_opacity: Option<f64>,
    pub title_orient: Option<Orient>,
    pub title_padding: Option<f64>,
}

Legend configuration, which determines default properties for all legends. For a full list of legend configuration options, please see the corresponding section of in the legend documentation.

Fields

clip_height: Option<f64>

The height in pixels to clip symbol legend entries and limit their size.

column_padding: Option<f64>

The horizontal padding in pixels between symbol legend entries.

Default value: 10.

columns: Option<f64>

The number of columns in which to arrange symbol legend entries. A value of 0 or lower indicates a single row with one column per entry.

corner_radius: Option<f64>

Corner radius for the full legend.

fill_color: Option<String>

Background fill color for the full legend.

gradient_direction: Option<Orientation>

The default direction ("horizontal" or "vertical") for gradient legends.

Default value: "vertical".

gradient_horizontal_max_length: Option<f64>

Max legend length for a horizontal gradient when config.legend.gradientLength is undefined.

Default value: 200

gradient_horizontal_min_length: Option<f64>

Min legend length for a horizontal gradient when config.legend.gradientLength is undefined.

Default value: 100

gradient_label_limit: Option<f64>

The maximum allowed length in pixels of color ramp gradient labels.

gradient_label_offset: Option<f64>

Vertical offset in pixels for color ramp gradient labels.

Default value: 2.

gradient_length: Option<f64>

The length in pixels of the primary axis of a color gradient. This value corresponds to the height of a vertical gradient or the width of a horizontal gradient.

Default value: 200.

gradient_opacity: Option<f64>

Opacity of the color gradient.

gradient_stroke_color: Option<String>

The color of the gradient stroke, can be in hex color code or regular color name.

Default value: "lightGray".

gradient_stroke_width: Option<f64>

The width of the gradient stroke, in pixels.

Default value: 0.

gradient_thickness: Option<f64>

The thickness in pixels of the color gradient. This value corresponds to the width of a vertical gradient or the height of a horizontal gradient.

Default value: 16.

gradient_vertical_max_length: Option<f64>

Max legend length for a vertical gradient when config.legend.gradientLength is undefined.

Default value: 200

gradient_vertical_min_length: Option<f64>

Min legend length for a vertical gradient when config.legend.gradientLength is undefined.

Default value: 100

grid_align: Option<LayoutAlign>

The alignment to apply to symbol legends rows and columns. The supported string values are "all", "each" (the default), and none. For more information, see the grid layout documentation.

Default value: "each".

label_align: Option<Align>

The alignment of the legend label, can be left, center, or right.

label_baseline: Option<TextBaseline>

The position of the baseline of legend label, can be "top", "middle", "bottom", or "alphabetic".

Default value: "middle".

label_color: Option<String>

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

label_font: Option<String>

The font of the legend label.

label_font_size: Option<f64>

The font size of legend label.

Default value: 10.

label_font_style: Option<String>

The font style of legend label.

label_font_weight: Option<FontWeight>

The font weight of legend label.

label_limit: Option<f64>

Maximum allowed pixel width of legend tick labels.

Default value: 160.

label_offset: Option<f64>

The offset of the legend label.

label_opacity: Option<f64>

Opacity of labels.

label_overlap: Option<LabelOverlap>

The strategy to use for resolving overlap of labels in gradient legends. If false, no overlap reduction is attempted. If set to true or "parity", a strategy of removing every other label is used. If set to "greedy", a linear scan of the labels is performed, removing any label that overlaps with the last visible label (this often works better for log-scaled axes).

Default value: "greedy" for log scales otherwise true`.

label_padding: Option<f64>

Padding in pixels between the legend and legend labels.

label_separation: Option<f64>

The minimum separation that must be between label bounding boxes for them to be considered non-overlapping (default 0). This property is ignored if labelOverlap resolution is not enabled.

layout: Option<LegendLayout>

Legend orient group layout parameters.

legend_x: Option<f64>

Custom x-position for legend with orient "none".

legend_y: Option<f64>

Custom y-position for legend with orient "none".

offset: Option<f64>

The offset in pixels by which to displace the legend from the data rectangle and axes.

Default value: 18.

orient: Option<LegendOrient>

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

Default value: "right"

padding: Option<f64>

The padding between the border and content of the legend group.

Default value: 0.

row_padding: Option<f64>

The vertical padding in pixels between symbol legend entries.

Default value: 2.

short_time_labels: Option<bool>

Whether month names and weekday names should be abbreviated.

Default value: false

stroke_color: Option<String>

Border stroke color for the full legend.

stroke_dash: Option<Vec<f64>>

Border stroke dash pattern for the full legend.

stroke_width: Option<f64>

Border stroke width for the full legend.

symbol_base_fill_color: Option<String>

Default fill color for legend symbols. Only applied if there is no "fill" scale color encoding for the legend.

Default value: "transparent".

symbol_base_stroke_color: Option<String>

Default stroke color for legend symbols. Only applied if there is no "fill" scale color encoding for the legend.

Default value: "gray".

symbol_dash: Option<Vec<f64>>

An array of alternating [stroke, space] lengths for dashed symbol strokes.

symbol_dash_offset: Option<f64>

The pixel offset at which to start drawing with the symbol stroke dash array.

symbol_direction: Option<Orientation>

The default direction ("horizontal" or "vertical") for symbol legends.

Default value: "vertical".

symbol_fill_color: Option<String>

The color of the legend symbol,

symbol_offset: Option<f64>

Horizontal pixel offset for legend symbols.

Default value: 0.

symbol_opacity: Option<f64>

Opacity of the legend symbols.

symbol_size: Option<f64>

The size of the legend symbol, in pixels.

Default value: 100.

symbol_stroke_color: Option<String>

Stroke color for legend symbols.

symbol_stroke_width: Option<f64>

The width of the symbol's stroke.

Default value: 1.5.

symbol_type: Option<String>

The symbol shape. One of the plotting shapes circle (default), square, cross, diamond, triangle-up, triangle-down, triangle-right, or triangle-left, the line symbol stroke, or one of the centered directional shapes arrow, wedge, or triangle. Alternatively, a custom SVG path string can be provided. For correct sizing, custom shape paths should be defined within a square bounding box with coordinates ranging from -1 to 1 along both the x and y dimensions.

Default value: "circle".

title: RemovableValue<Value>

Set to null to disable title for the axis, legend, or header.

title_align: Option<Align>

Horizontal text alignment for legend titles.

Default value: "left".

title_anchor: Option<TitleAnchor>

Text anchor position for placing legend titles.

title_baseline: Option<TextBaseline>

Vertical text baseline for legend titles.

Default value: "top".

title_color: Option<String>

The color of the legend title, can be in hex color code or regular color name.

title_font: Option<String>

The font of the legend title.

title_font_size: Option<f64>

The font size of the legend title.

title_font_style: Option<String>

The font style of the legend title.

title_font_weight: Option<FontWeight>

The font weight of the legend 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>

Maximum allowed pixel width of legend titles.

Default value: 180.

title_opacity: Option<f64>

Opacity of the legend title.

title_orient: Option<Orient>

Orientation of the legend title.

title_padding: Option<f64>

The padding, in pixels, between title and legend.

Default value: 5.

Trait Implementations

impl Clone for LegendConfig[src]

impl Debug for LegendConfig[src]

impl Default for LegendConfig[src]

impl<'de> Deserialize<'de> for LegendConfig[src]

impl Serialize for LegendConfig[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> DeserializeOwned for T where
    T: Deserialize<'de>, 
[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.