Struct vega_lite_4::StyleValue
source · pub struct StyleValue {Show 152 fields
pub align: Option<TitleAlignUnion>,
pub angle: Option<Angle>,
pub aria: Option<Aria>,
pub aria_role: Option<Box<Color>>,
pub aria_role_description: Option<Box<Color>>,
pub aspect: Option<Aria>,
pub baseline: Option<TextBaseline>,
pub bin_spacing: Option<f64>,
pub blend: Option<BlendUnion>,
pub color: Option<StyleColor>,
pub continuous_band_size: Option<f64>,
pub corner_radius: Option<CornerRadiusUnion>,
pub corner_radius_bottom_left: Option<CornerRadiusUnion>,
pub corner_radius_bottom_right: Option<CornerRadiusUnion>,
pub corner_radius_top_left: Option<CornerRadiusUnion>,
pub corner_radius_top_right: Option<CornerRadiusUnion>,
pub cursor: Option<CursorUnion>,
pub description: Option<Box<Color>>,
pub dir: Option<Dir>,
pub discrete_band_size: Option<f64>,
pub dx: Option<CornerRadiusUnion>,
pub dy: Option<CornerRadiusUnion>,
pub ellipsis: Option<Box<Color>>,
pub end_angle: Option<CornerRadiusUnion>,
pub fill: Option<StyleFill>,
pub filled: Option<bool>,
pub fill_opacity: Option<Opacity>,
pub font: Option<Box<Color>>,
pub font_size: Option<FontSize>,
pub font_style: Option<Box<Color>>,
pub font_weight: Option<FontWeightUnion>,
pub height: Option<CornerRadiusUnion>,
pub href: Option<Box<Color>>,
pub inner_radius: Option<CornerRadiusUnion>,
pub interpolate: Option<MarkConfigExprOrSignalRefInterpolate>,
pub invalid: RemovableValue<Invalid>,
pub limit: Option<CornerRadiusUnion>,
pub line_break: Option<Box<Color>>,
pub line_height: Option<CornerRadiusUnion>,
pub opacity: Option<Opacity>,
pub order: Option<bool>,
pub orient: Option<StyleOrient>,
pub outer_radius: Option<CornerRadiusUnion>,
pub pad_angle: Option<CornerRadiusUnion>,
pub radius: Option<CornerRadiusUnion>,
pub radius2: Option<CornerRadiusUnion>,
pub shape: Option<Box<Color>>,
pub size: Option<FontSize>,
pub smooth: Option<Aria>,
pub start_angle: Option<CornerRadiusUnion>,
pub stroke: Option<StyleFill>,
pub stroke_cap: Option<Cap>,
pub stroke_dash: Option<StrokeDashUnion>,
pub stroke_dash_offset: Option<CornerRadiusUnion>,
pub stroke_join: Option<StrokeJoinUnion>,
pub stroke_miter_limit: Option<CornerRadiusUnion>,
pub stroke_offset: Option<CornerRadiusUnion>,
pub stroke_opacity: Option<Opacity>,
pub stroke_width: Option<FontSize>,
pub tension: Option<CornerRadiusUnion>,
pub text: Option<ConditionalPredicateValueDefTextExprRefText>,
pub theta: Option<Angle>,
pub theta2: Option<CornerRadiusUnion>,
pub time_unit_band: Option<f64>,
pub time_unit_band_position: Option<f64>,
pub tooltip: Option<StyleTooltip>,
pub url: Option<Box<Color>>,
pub width: Option<CornerRadiusUnion>,
pub x: Option<XUnion>,
pub x2: Option<XUnion>,
pub y: Option<YUnion>,
pub y2: Option<YUnion>,
pub line: Option<Line>,
pub point: Option<PointUnion>,
pub corner_radius_end: Option<CornerRadiusUnion>,
pub band_size: Option<f64>,
pub thickness: Option<f64>,
pub band_position: Option<CornerRadiusUnion>,
pub domain: Option<Aria>,
pub domain_cap: Option<Cap>,
pub domain_color: Option<Box<Color>>,
pub domain_dash: Option<StrokeDashUnion>,
pub domain_dash_offset: Option<CornerRadiusUnion>,
pub domain_opacity: Option<CornerRadiusUnion>,
pub domain_width: Option<CornerRadiusUnion>,
pub format: Option<Format>,
pub format_type: Option<String>,
pub grid: Option<bool>,
pub grid_cap: Option<Cap>,
pub grid_color: Option<GridColorUnion>,
pub grid_dash: Option<AxisGridDash>,
pub grid_dash_offset: Option<GridDashOffsetUnion>,
pub grid_opacity: Option<GridOpacityUnion>,
pub grid_width: Option<GridWidthUnion>,
pub label_align: Option<ConditionalAxisPropertyAlignNull>,
pub label_angle: Option<LabelAngle>,
pub label_baseline: Option<PurpleTextBaseline>,
pub label_bound: Option<Label>,
pub label_color: Option<GridColorUnion>,
pub label_expr: Option<String>,
pub label_flush: Option<LabelFlush>,
pub label_flush_offset: Option<CornerRadiusUnion>,
pub label_font: Option<ConditionalAxisPropertyStringNull>,
pub label_font_size: Option<GridWidthUnion>,
pub label_font_style: Option<ConditionalAxisPropertyFontStyleNull>,
pub label_font_weight: Option<FontWeight>,
pub label_limit: Option<CornerRadiusUnion>,
pub label_line_height: Option<CornerRadiusUnion>,
pub label_offset: Option<GridDashOffsetUnion>,
pub label_opacity: Option<GridDashOffsetUnion>,
pub label_overlap: Option<LabelOverlapUnion>,
pub label_padding: Option<GridDashOffsetUnion>,
pub labels: Option<Aria>,
pub label_separation: Option<CornerRadiusUnion>,
pub max_extent: Option<CornerRadiusUnion>,
pub min_extent: Option<CornerRadiusUnion>,
pub offset: Option<f64>,
pub position: Option<CornerRadiusUnion>,
pub style: Option<LegendText>,
pub tick_band: Option<TickBandUnion>,
pub tick_cap: Option<Cap>,
pub tick_color: Option<GridColorUnion>,
pub tick_count: Option<TickCount>,
pub tick_dash: Option<AxisTickDash>,
pub tick_dash_offset: Option<GridDashOffsetUnion>,
pub tick_extra: Option<Aria>,
pub tick_min_step: Option<CornerRadiusUnion>,
pub tick_offset: Option<CornerRadiusUnion>,
pub tick_opacity: Option<GridDashOffsetUnion>,
pub tick_round: Option<Aria>,
pub ticks: Option<Aria>,
pub tick_size: Option<GridWidthUnion>,
pub tick_width: Option<GridWidthUnion>,
pub title: RemovableValue<LegendText>,
pub title_align: Option<TitleAlignUnion>,
pub title_anchor: Option<TitleAnchorUnion>,
pub title_angle: Option<CornerRadiusUnion>,
pub title_baseline: Option<TextBaseline>,
pub title_color: Option<Box<Color>>,
pub title_font: Option<Box<Color>>,
pub title_font_size: Option<FontSize>,
pub title_font_style: Option<Box<Color>>,
pub title_font_weight: Option<FontWeightUnion>,
pub title_limit: Option<FontSize>,
pub title_line_height: Option<CornerRadiusUnion>,
pub title_opacity: Option<CornerRadiusUnion>,
pub title_padding: Option<CornerRadiusUnion>,
pub title_x: Option<CornerRadiusUnion>,
pub title_y: Option<CornerRadiusUnion>,
pub translate: Option<CornerRadiusUnion>,
pub values: Option<Values>,
pub zindex: Option<f64>,
}
Expand description
Arc-specific Config
Image-specific Config
Rect-Specific Config
Area-Specific Config
Bar-Specific Config
Circle-Specific Config
Geoshape-Specific Config
Mark Config
Point-Specific Config
Rule-Specific Config
Square-Specific Config
Default style for chart subtitles
Default style for chart titles
Default style for axis, legend, and header labels.
Default style for axis, legend, and header titles.
Text-Specific Config
Line-Specific Config
Trail-Specific Config
Tick-Specific Config
Fields§
§align: Option<TitleAlignUnion>
The horizontal alignment of the text or ranged marks (area, bar, image, rect, rule). One
of "left"
, "right"
, "center"
.
Note: Expression reference is not supported for range marks.
angle: Option<Angle>
The rotation angle of the text, in degrees.
aria: Option<Aria>
A boolean flag indicating if ARIA
attributes should be
included (SVG output only). If false
, the “aria-hidden” attribute will be set on the
output SVG element, removing the mark item from the ARIA accessibility tree.
aria_role: Option<Box<Color>>
Sets the type of user interface element of the mark item for ARIA accessibility (SVG output only). If specified, this property determines the “role” attribute. Warning: this property is experimental and may be changed in the future.
aria_role_description: Option<Box<Color>>
A human-readable, author-localized description for the role of the mark item for ARIA accessibility (SVG output only). If specified, this property determines the “aria-roledescription” attribute. Warning: this property is experimental and may be changed in the future.
aspect: Option<Aria>
Whether to keep aspect ratio of image marks.
baseline: Option<TextBaseline>
For text marks, the vertical text baseline. One of "alphabetic"
(default), "top"
,
"middle"
, "bottom"
, "line-top"
, "line-bottom"
, or an expression reference that
provides one of the valid values. The "line-top"
and "line-bottom"
values operate
similarly to "top"
and "bottom"
, but are calculated relative to the lineHeight
rather than fontSize
alone.
For range marks, the vertical alignment of the marks. One of "top"
, "middle"
,
"bottom"
.
Note: Expression reference is not supported for range marks.
bin_spacing: Option<f64>
Offset between bars for binned field. The ideal value for this is either 0 (preferred by statisticians) or 1 (Vega-Lite default, D3 example style).
Default value: 1
blend: Option<BlendUnion>
The color blend mode for drawing an item on its current background. Any valid CSS mix-blend-mode value can be used.
__Default value: "source-over"
color: Option<StyleColor>
Default color.
Default value: ■ "#4682b4"
Note: - This property cannot be used in a style
config. - The fill
and
stroke
properties have higher precedence than color
and will override color
.
continuous_band_size: Option<f64>
The default size of the bars on continuous scales.
Default value: 5
corner_radius: Option<CornerRadiusUnion>
The radius in pixels of rounded rectangles or arcs’ corners.
Default value: 0
corner_radius_bottom_left: Option<CornerRadiusUnion>
The radius in pixels of rounded rectangles’ bottom left corner.
Default value: 0
corner_radius_bottom_right: Option<CornerRadiusUnion>
The radius in pixels of rounded rectangles’ bottom right corner.
Default value: 0
corner_radius_top_left: Option<CornerRadiusUnion>
The radius in pixels of rounded rectangles’ top right corner.
Default value: 0
corner_radius_top_right: Option<CornerRadiusUnion>
The radius in pixels of rounded rectangles’ top left corner.
Default value: 0
cursor: Option<CursorUnion>
The mouse cursor used over the mark. Any valid CSS cursor type can be used.
description: Option<Box<Color>>
A text description of the mark item for ARIA accessibility (SVG output only). If specified, this property determines the “aria-label” attribute.
dir: Option<Dir>
The direction of the text. One of "ltr"
(left-to-right) or "rtl"
(right-to-left).
This property determines on which side is truncated in response to the limit parameter.
Default value: "ltr"
discrete_band_size: Option<f64>
The default size of the bars with discrete dimensions. If unspecified, the default size
is step-2
, which provides 2 pixel offset between bars.
dx: Option<CornerRadiusUnion>
The horizontal offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.
dy: Option<CornerRadiusUnion>
The vertical offset, in pixels, between the text label and its anchor point. The offset is applied after rotation by the angle property.
ellipsis: Option<Box<Color>>
The ellipsis string for text truncated in response to the limit parameter.
Default value: "…"
end_angle: Option<CornerRadiusUnion>
The end angle in radians for arc marks. A value of 0
indicates up (north), increasing
values proceed clockwise.
fill: Option<StyleFill>
Default fill color. This property has higher precedence than config.color
. Set to
null
to remove fill.
Default value: (None)
filled: Option<bool>
Whether the mark’s color should be used as fill color instead of stroke color.
Default value: false
for all point
, line
, and rule
marks as well as
geoshape
marks for
graticule
data sources;
otherwise, true
.
Note: This property cannot be used in a style config.
fill_opacity: Option<Opacity>
The fill opacity (value between [0,1]).
Default value: 1
font: Option<Box<Color>>
The typeface to set the text in (e.g., "Helvetica Neue"
).
font_size: Option<FontSize>
The font size, in pixels.
Default value: 11
font_style: Option<Box<Color>>
The font style (e.g., "italic"
).
font_weight: Option<FontWeightUnion>
The font weight. This can be either a string (e.g "bold"
, "normal"
) or a number
(100
, 200
, 300
, …, 900
where "normal"
= 400
and "bold"
= 700
).
height: Option<CornerRadiusUnion>
Height of the marks.
href: Option<Box<Color>>
A URL to load upon mouse click. If defined, the mark acts as a hyperlink.
inner_radius: Option<CornerRadiusUnion>
The inner radius in pixels of arc marks. innerRadius
is an alias for radius2
.
interpolate: Option<MarkConfigExprOrSignalRefInterpolate>
The line interpolation method to use for line and area marks. One of the following: -
"linear"
: piecewise linear segments, as in a polyline. - "linear-closed"
: close the
linear segments to form a polygon. - "step"
: alternate between horizontal and vertical
segments, as in a step function. - "step-before"
: alternate between vertical and
horizontal segments, as in a step function. - "step-after"
: alternate between
horizontal and vertical segments, as in a step function. - "basis"
: a B-spline, with
control point duplication on the ends. - "basis-open"
: an open B-spline; may not
intersect the start or end. - "basis-closed"
: a closed B-spline, as in a loop. -
"cardinal"
: a Cardinal spline, with control point duplication on the ends. -
"cardinal-open"
: an open Cardinal spline; may not intersect the start or end, but will
intersect other control points. - "cardinal-closed"
: a closed Cardinal spline, as in a
loop. - "bundle"
: equivalent to basis, except the tension parameter is used to
straighten the spline. - "monotone"
: cubic interpolation that preserves monotonicity in
y.
invalid: RemovableValue<Invalid>
Defines how Vega-Lite should handle marks for invalid values (null
and NaN
). - If set
to "filter"
(default), all data items with null values will be skipped (for line,
trail, and area marks) or filtered (for other marks). - If null
, all data items are
included. In this case, invalid values will be interpreted as zeroes.
limit: Option<CornerRadiusUnion>
The maximum length of the text mark in pixels. The text value will be automatically truncated if the rendered size exceeds the limit.
Default value: 0
– indicating no limit
line_break: Option<Box<Color>>
A delimiter, such as a newline character, upon which to break text strings into multiple lines. This property is ignored if the text is array-valued.
line_height: Option<CornerRadiusUnion>
The line height in pixels (the spacing between subsequent lines of text) for multi-line text marks.
opacity: Option<Opacity>
The overall opacity (value between [0,1]).
Default value: 0.7
for non-aggregate plots with point
, tick
, circle
, or
square
marks or layered bar
charts and 1
otherwise.
order: Option<bool>
For line and trail marks, this order
property can be set to null
or false
to make
the lines use the original order in the data sources.
orient: Option<StyleOrient>
The orientation of a non-stacked bar, tick, area, and line charts. The value is either
horizontal (default) or vertical. - For bar, rule and tick, this determines whether the
size of the bar and tick should be applied to x or y dimension. - For area, this property
determines the orient property of the Vega output. - For line and trail marks, this
property determines the sort order of the points in the line if config.sortLineBy
is
not specified. For stacked charts, this is always determined by the orientation of the
stack; therefore explicitly specified value will be ignored.
The orientation of the axis. One of "top"
, "bottom"
, "left"
or "right"
. The
orientation can be used to further specialize the axis type (e.g., a y-axis oriented
towards the right edge of the chart).
Default value: "bottom"
for x-axes and "left"
for y-axes.
outer_radius: Option<CornerRadiusUnion>
The outer radius in pixels of arc marks. outerRadius
is an alias for radius
.
pad_angle: Option<CornerRadiusUnion>
The angular padding applied to sides of the arc, in radians.
radius: Option<CornerRadiusUnion>
For arc mark, the primary (outer) radius in pixels.
For text marks, polar coordinate radial offset, in pixels, of the text from the origin
determined by the x
and y
properties.
radius2: Option<CornerRadiusUnion>
The secondary (inner) radius in pixels of arc marks.
shape: Option<Box<Color>>
Shape of the point marks. Supported values include: - plotting shapes: "circle"
,
"square"
, "cross"
, "diamond"
, "triangle-up"
, "triangle-down"
,
"triangle-right"
, or "triangle-left"
. - the line symbol "stroke"
- centered
directional shapes "arrow"
, "wedge"
, or "triangle"
- a custom SVG path
string (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"
size: Option<FontSize>
Default size for marks. - For point
/circle
/square
, this represents the pixel area
of the marks. Note that this value sets the area of the symbol; the side lengths will
increase with the square root of this value. - For bar
, this represents the band size
of the bar, in pixels. - For text
, this represents the font size, in pixels.
Default value: - 30
for point, circle, square marks; width/height’s step
- 2
for bar marks with discrete dimensions; - 5
for bar marks with continuous dimensions; -
11
for text marks.
smooth: Option<Aria>
A boolean flag (default true) indicating if the image should be smoothed when resized. If false, individual pixels should be scaled directly rather than interpolated with smoothing. For SVG rendering, this option may not work in some browsers due to lack of standardization.
start_angle: Option<CornerRadiusUnion>
The start angle in radians for arc marks. A value of 0
indicates up (north), increasing
values proceed clockwise.
stroke: Option<StyleFill>
Default stroke color. This property has higher precedence than config.color
. Set to
null
to remove stroke.
Default value: (None)
stroke_cap: Option<Cap>
The stroke cap for line ending style. One of "butt"
, "round"
, or "square"
.
Default value: "butt"
stroke_dash: Option<StrokeDashUnion>
An array of alternating stroke, space lengths for creating dashed or dotted lines.
stroke_dash_offset: Option<CornerRadiusUnion>
The offset (in pixels) into which to begin drawing with the stroke dash array.
stroke_join: Option<StrokeJoinUnion>
The stroke line join method. One of "miter"
, "round"
or "bevel"
.
Default value: "miter"
stroke_miter_limit: Option<CornerRadiusUnion>
The miter limit at which to bevel a line join.
stroke_offset: Option<CornerRadiusUnion>
The offset in pixels at which to draw the group stroke and fill. If unspecified, the default behavior is to dynamically offset stroked groups such that 1 pixel stroke widths align with the pixel grid.
stroke_opacity: Option<Opacity>
The stroke opacity (value between [0,1]).
Default value: 1
stroke_width: Option<FontSize>
The stroke width, in pixels.
tension: Option<CornerRadiusUnion>
Depending on the interpolation type, sets the tension parameter (for line and area marks).
text: Option<ConditionalPredicateValueDefTextExprRefText>
Text-Specific Config
Placeholder text if the text
channel is not specified
theta: Option<Angle>
-
For arc marks, the arc length in radians if theta2 is not specified, otherwise the start arc angle. (A value of 0 indicates up or “north”, increasing values proceed clockwise.)
-
For text marks, polar coordinate angle in radians.
theta2: Option<CornerRadiusUnion>
The end angle of arc marks in radians. A value of 0 indicates up or “north”, increasing values proceed clockwise.
time_unit_band: Option<f64>
Default relative band size for a time unit. If set to 1
, the bandwidth of the marks
will be equal to the time unit band step. If set to 0.5
, bandwidth of the marks will be
half of the time unit band step.
time_unit_band_position: Option<f64>
Default relative band position for a time unit. If set to 0
, the marks will be
positioned at the beginning of the time unit band step. If set to 0.5
, the marks will
be positioned in the middle of the time unit band step.
tooltip: Option<StyleTooltip>
The tooltip text string to show upon mouse hover or an object defining which fields should the tooltip be derived from.
- If
tooltip
istrue
or{"content": "encoding"}
, then all fields fromencoding
will be used. - Iftooltip
is{"content": "data"}
, then all fields that appear in the highlighted data point will be used. - If set tonull
orfalse
, then no tooltip will be used.
See the tooltip
documentation for
a detailed discussion about tooltip in Vega-Lite.
Default value: null
url: Option<Box<Color>>
The URL of the image file for image marks.
width: Option<CornerRadiusUnion>
Width of the marks.
x: Option<XUnion>
X coordinates of the marks, or width of horizontal "bar"
and "area"
without specified
x2
or width
.
The value
of this channel can be a number or a string "width"
for the width of the
plot.
x2: Option<XUnion>
X2 coordinates for ranged "area"
, "bar"
, "rect"
, and "rule"
.
The value
of this channel can be a number or a string "width"
for the width of the
plot.
y: Option<YUnion>
Y coordinates of the marks, or height of vertical "bar"
and "area"
without specified
y2
or height
.
The value
of this channel can be a number or a string "height"
for the height of the
plot.
y2: Option<YUnion>
Y2 coordinates for ranged "area"
, "bar"
, "rect"
, and "rule"
.
The value
of this channel can be a number or a string "height"
for the height of the
plot.
line: Option<Line>
A flag for overlaying line on top of area marks, or an object defining the properties of the overlayed lines.
-
If this value is an empty object (
{}
) ortrue
, lines with default properties will be used. -
If this value is
false
, no lines would be automatically added to area marks.
Default value: false
.
Line-Specific Config
point: Option<PointUnion>
A flag for overlaying points on top of line or area marks, or an object defining the properties of the overlayed points.
-
If this property is
"transparent"
, transparent points will be used (for enhancing tooltips and selections). -
If this property is an empty object (
{}
) ortrue
, filled points with default properties will be used. -
If this property is
false
, no points would be automatically added to line or area marks.
Default value: false
.
Point-Specific Config
corner_radius_end: Option<CornerRadiusUnion>
- For vertical bars, top-left and top-right corner radius. - For horizontal bars, top-right and bottom-right corner radius.
band_size: Option<f64>
The width of the ticks.
Default value: 3/4 of step (width step for horizontal ticks and height step for vertical ticks).
thickness: Option<f64>
Thickness of the tick mark.
Default value: 1
band_position: Option<CornerRadiusUnion>
§domain: Option<Aria>
§domain_cap: Option<Cap>
§domain_color: Option<Box<Color>>
§domain_dash: Option<StrokeDashUnion>
§domain_dash_offset: Option<CornerRadiusUnion>
§domain_opacity: Option<CornerRadiusUnion>
§domain_width: Option<CornerRadiusUnion>
§format: Option<Format>
When used with the default "number"
and "time"
format type, the text formatting
pattern for labels of guides (axes, legends, headers) and text marks.
- If the format type is
"number"
(e.g., for quantitative fields), this is D3’s number format pattern. - If the format type is"time"
(e.g., for temporal fields), this is D3’s time format pattern.
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.
format_type: Option<String>
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
.
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_cap: Option<Cap>
§grid_color: Option<GridColorUnion>
§grid_dash: Option<AxisGridDash>
§grid_dash_offset: Option<GridDashOffsetUnion>
§grid_opacity: Option<GridOpacityUnion>
§grid_width: Option<GridWidthUnion>
§label_align: Option<ConditionalAxisPropertyAlignNull>
§label_angle: Option<LabelAngle>
§label_baseline: Option<PurpleTextBaseline>
§label_bound: Option<Label>
§label_color: Option<GridColorUnion>
§label_expr: Option<String>
Vega expression for customizing labels.
Note: The label text and value can be assessed via the label
and value
properties
of the axis’s backing datum
object.
label_flush: Option<LabelFlush>
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_flush_offset: Option<CornerRadiusUnion>
§label_font: Option<ConditionalAxisPropertyStringNull>
§label_font_size: Option<GridWidthUnion>
§label_font_style: Option<ConditionalAxisPropertyFontStyleNull>
§label_font_weight: Option<FontWeight>
§label_limit: Option<CornerRadiusUnion>
§label_line_height: Option<CornerRadiusUnion>
§label_offset: Option<GridDashOffsetUnion>
§label_opacity: Option<GridDashOffsetUnion>
§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<GridDashOffsetUnion>
§labels: Option<Aria>
§label_separation: Option<CornerRadiusUnion>
§max_extent: Option<CornerRadiusUnion>
§min_extent: Option<CornerRadiusUnion>
§offset: Option<f64>
The offset, in pixels, by which to displace the axis from the edge of the enclosing group or data rectangle.
Default value: derived from the axis
config’s offset
(0
by default)
position: Option<CornerRadiusUnion>
The anchor position of the axis in pixels. For x-axes with top or bottom orientation, this sets the axis group x coordinate. For y-axes with left or right orientation, this sets the axis group y coordinate.
Default value: 0
style: Option<LegendText>
A string or array of strings indicating the name of custom styles to apply to the axis. A style is a named collection of axis property defined within the style configuration. If style is an array, later styles will override earlier styles.
Default value: (none) Note: Any specified style will augment the default style.
For example, an x-axis mark with "style": "foo"
will use config.axisX
and
config.style.foo
(the specified style "foo"
has higher precedence).
tick_band: Option<TickBandUnion>
§tick_cap: Option<Cap>
§tick_color: Option<GridColorUnion>
§tick_count: Option<TickCount>
A desired number of ticks, for axes visualizing quantitative scales. The resulting number may be different so that values are “nice” (multiples of 2, 5, 10) and lie within the underlying scale’s range.
For scales of type "time"
or "utc"
, the tick count can instead be a time interval
specifier. Legal string values are "millisecond"
, "second"
, "minute"
, "hour"
,
"day"
, "week"
, "month"
, and "year"
. Alternatively, an object-valued interval
specifier of the form {"interval": "month", "step": 3}
includes a desired number of
interval steps. Here, ticks are generated for each quarter (Jan, Apr, Jul, Oct)
boundary.
Default value: Determine using a formula ceil(width/40)
for x and ceil(height/40)
for y.
tick_dash: Option<AxisTickDash>
§tick_dash_offset: Option<GridDashOffsetUnion>
§tick_extra: Option<Aria>
§tick_min_step: Option<CornerRadiusUnion>
The minimum desired step between axis 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.
tick_offset: Option<CornerRadiusUnion>
§tick_opacity: Option<GridDashOffsetUnion>
§tick_round: Option<Aria>
§ticks: Option<Aria>
§tick_size: Option<GridWidthUnion>
§tick_width: Option<GridWidthUnion>
§title: RemovableValue<LegendText>
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:
-
You can customize the default field title format by providing the
fieldTitle
property in the config orfieldTitle
function via thecompile
function’s options. -
If both field definition’s
title
and axis, header, or legendtitle
are defined, axis/header/legend title will be used.
title_align: Option<TitleAlignUnion>
§title_anchor: Option<TitleAnchorUnion>
§title_angle: Option<CornerRadiusUnion>
§title_baseline: Option<TextBaseline>
§title_color: Option<Box<Color>>
§title_font: Option<Box<Color>>
§title_font_size: Option<FontSize>
§title_font_style: Option<Box<Color>>
§title_font_weight: Option<FontWeightUnion>
§title_limit: Option<FontSize>
§title_line_height: Option<CornerRadiusUnion>
§title_opacity: Option<CornerRadiusUnion>
§title_padding: Option<CornerRadiusUnion>
§title_x: Option<CornerRadiusUnion>
§title_y: Option<CornerRadiusUnion>
§translate: Option<CornerRadiusUnion>
§values: Option<Values>
Explicitly set the visible axis tick values.
zindex: Option<f64>
A non-negative integer indicating the z-index of the axis. If zindex is 0, axes should be
drawn behind all chart elements. To put them in front, set zindex
to 1
or more.
Default value: 0
(behind the marks).
Trait Implementations§
source§impl Clone for StyleValue
impl Clone for StyleValue
source§fn clone(&self) -> StyleValue
fn clone(&self) -> StyleValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more