Struct vega_lite::AxisConfig

source ·
pub struct AxisConfig {
Show 39 fields pub band_position: Option<f64>, pub domain: Option<bool>, pub domain_color: Option<String>, pub domain_width: Option<f64>, pub grid: Option<bool>, pub grid_color: Option<String>, pub grid_dash: Option<Vec<f64>>, pub grid_opacity: Option<f64>, pub grid_width: Option<f64>, pub label_angle: Option<f64>, pub label_bound: Option<Label>, pub label_color: Option<String>, pub label_flush: Option<Label>, pub label_font: Option<String>, pub label_font_size: Option<f64>, pub label_limit: Option<f64>, pub label_overlap: Option<LabelOverlapUnion>, pub label_padding: Option<f64>, pub labels: Option<bool>, pub max_extent: Option<f64>, pub min_extent: Option<f64>, pub short_time_labels: Option<bool>, pub tick_color: Option<String>, pub tick_round: Option<bool>, pub ticks: Option<bool>, pub tick_size: Option<f64>, pub tick_width: Option<f64>, pub title_align: Option<String>, pub title_angle: Option<f64>, pub title_baseline: Option<String>, 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>, pub title_max_length: Option<f64>, pub title_padding: Option<f64>, pub title_x: Option<f64>, pub title_y: Option<f64>,
}
Expand description

Axis configuration, which determines default properties for all x and y axes. For a full list of axis configuration options, please see the corresponding section of the axis documentation.

Fields§

§band_position: Option<f64>

An interpolation fraction indicating where, for band scales, axis ticks should be positioned. A value of 0 places ticks at the left edge of their bands. A value of 0.5 places ticks in the middle of their bands.

§domain: Option<bool>

A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.

Default value: true

§domain_color: Option<String>

Color of axis domain line.

Default value: (none, using Vega default).

§domain_width: Option<f64>

Stroke width of axis domain line

Default value: (none, using Vega default).

§grid: Option<bool>

A boolean flag indicating if grid lines should be included as part of the axis

Default value: true for continuous scales that are not binned; otherwise, false.

§grid_color: Option<String>

Color of gridlines.

§grid_dash: Option<Vec<f64>>

The offset (in pixels) into which to begin drawing with the grid dash array.

§grid_opacity: Option<f64>

The stroke opacity of grid (value between [0,1])

Default value: (1 by default)

§grid_width: Option<f64>

The grid width, in pixels.

§label_angle: Option<f64>

The rotation angle of the axis labels.

Default value: -90 for nominal and ordinal fields; 0 otherwise.

§label_bound: Option<Label>

Indicates if labels should be hidden if they exceed the axis range. If false (the default) no bounds overlap analysis is performed. If true, labels will be hidden if they exceed the axis range by more than 1 pixel. If this property is a number, it specifies the pixel tolerance: the maximum amount by which a label bounding box may exceed the axis range.

Default value: false.

§label_color: Option<String>

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

§label_flush: Option<Label>

Indicates if the first and last axis labels should be aligned flush with the scale range. Flush alignment for a horizontal axis will left-align the first label and right-align the last label. For vertical axes, bottom and top text baselines are applied instead. If this property is a number, it also indicates the number of pixels by which to offset the first and last labels; for example, a value of 2 will flush-align the first and last labels and also push them 2 pixels outward from the center of the axis. The additional adjustment can sometimes help the labels better visually group with corresponding axis ticks.

Default value: true for axis of a continuous x-scale. Otherwise, false.

§label_font: Option<String>

The font of the tick label.

§label_font_size: Option<f64>

The font size of the label, in pixels.

§label_limit: Option<f64>

Maximum allowed pixel width of axis tick labels.

§label_overlap: Option<LabelOverlapUnion>

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

Default value: true for non-nominal fields with non-log scales; "greedy" for log scales; otherwise false.

§label_padding: Option<f64>

The padding, in pixels, between axis and text labels.

§labels: Option<bool>

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

Default value: true.

§max_extent: Option<f64>

The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.

Default value: undefined.

§min_extent: Option<f64>

The minimum extent in pixels that axis ticks and labels should use. This determines a minimum offset value for axis titles.

Default value: 30 for y-axis; undefined for x-axis.

§short_time_labels: Option<bool>

Whether month names and weekday names should be abbreviated.

Default value: false

§tick_color: Option<String>

The color of the axis’s tick.

§tick_round: Option<bool>

Boolean flag indicating if pixel position values should be rounded to the nearest integer.

§ticks: Option<bool>

Boolean value that determines whether the axis should include ticks.

§tick_size: Option<f64>

The size in pixels of axis ticks.

§tick_width: Option<f64>

The width, in pixels, of ticks.

§title_align: Option<String>

Horizontal text alignment of axis titles.

§title_angle: Option<f64>

Angle in degrees of axis titles.

§title_baseline: Option<String>

Vertical text baseline for axis titles.

§title_color: Option<String>

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

§title_font: Option<String>

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

§title_font_size: Option<f64>

Font size of the title.

§title_font_weight: Option<FontWeight>

Font weight of the 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 axis titles.

§title_max_length: Option<f64>

Max length for axis title if the title is automatically generated from the field’s description.

§title_padding: Option<f64>

The padding, in pixels, between title and axis.

§title_x: Option<f64>

X-coordinate of the axis title relative to the axis group.

§title_y: Option<f64>

Y-coordinate of the axis title relative to the axis group.

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.