- Companion
- object
Value members
Inherited methods
Concrete fields
The type of legend to include. One of "symbol"
for discrete symbol legends, or "gradient"
for a continuous color gradient. If gradient is used only the fill or stroke scale parameters are considered. If unspecified, the type will be inferred based on the scale parameters used and their backing scale types.
The type of legend to include. One of "symbol"
for discrete symbol legends, or "gradient"
for a continuous color gradient. If gradient is used only the fill or stroke scale parameters are considered. If unspecified, the type will be inferred based on the scale parameters used and their backing scale types.
The direction of the legend, one of "vertical"
(default) or "horizontal"
.
The direction of the legend, one of "vertical"
(default) or "horizontal"
.
Default value: "vertical"
Mark definitions for custom legend encoding.
Mark definitions for custom legend encoding.
The format specifier pattern for legend labels. For numerical values, must be a legal d3-format specifier. For date-time values, must be a legal d3-time-format specifier or multi-format object.
The format specifier pattern for legend labels. For numerical values, must be a legal d3-format specifier. For date-time values, must be a legal d3-time-format specifier or multi-format object.
The format type for legend labels (number, time, or utc).
The format type for legend labels (number, time, or utc).
The minimum desired step between tick values for quantitative legends, 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.
The minimum desired step between tick values for quantitative legends, 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.
Inherited fields
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 group, removing the legend from the ARIA accessibility tree.
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 group, removing the legend from the ARIA accessibility tree.
Default value: true
- Inherited from
- BaseLegend
The height in pixels to clip symbol legend entries and limit their size.
The height in pixels to clip symbol legend entries and limit their size.
- Inherited from
- BaseLegend
The horizontal padding in pixels between symbol legend entries.
The horizontal padding in pixels between symbol legend entries.
Default value: 10
.
- Inherited from
- BaseLegend
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.
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.
- Inherited from
- BaseLegend
Corner radius for the full legend.
Corner radius for the full legend.
- Inherited from
- BaseLegend
A text description of this legend for ARIA accessibility (SVG output only).
If the aria
property is true, for SVG output the "aria-label" attribute will be set to this description.
If the description is unspecified it will be automatically generated.
A text description of this legend for ARIA accessibility (SVG output only).
If the aria
property is true, for SVG output the "aria-label" attribute will be set to this description.
If the description is unspecified it will be automatically generated.
- Inherited from
- BaseLegend
Background fill color for the full legend.
Background fill color for the full legend.
- Inherited from
- BaseLegend
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.
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
.
- Inherited from
- BaseLegend
Opacity of the color gradient.
Opacity of the color gradient.
- Inherited from
- BaseLegend
The color of the gradient stroke, can be in hex color code or regular color name.
The color of the gradient stroke, can be in hex color code or regular color name.
Default value: "lightGray"
.
- Inherited from
- BaseLegend
The width of the gradient stroke, in pixels.
The width of the gradient stroke, in pixels.
Default value: 0
.
- Inherited from
- BaseLegend
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.
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
.
- Inherited from
- BaseLegend
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.
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"
.
- Inherited from
- BaseLegend
The alignment of the legend label, can be left, center, or right.
The alignment of the legend label, can be left, center, or right.
- Inherited from
- BaseLegend
The position of the baseline of legend label, can be "top"
, "middle"
, "bottom"
, or "alphabetic"
.
The position of the baseline of legend label, can be "top"
, "middle"
, "bottom"
, or "alphabetic"
.
Default value: "middle"
.
- Inherited from
- BaseLegend
The color of the legend label, can be in hex color code or regular color name.
The color of the legend label, can be in hex color code or regular color name.
- Inherited from
- BaseLegend
The font of the legend label.
The font of the legend label.
- Inherited from
- BaseLegend
The font size of legend label.
The font size of legend label.
Default value: 10
.
- Inherited from
- BaseLegend
The font style of legend label.
The font style of legend label.
- Inherited from
- BaseLegend
The font weight of legend label.
The font weight of legend label.
- Inherited from
- BaseLegend
Maximum allowed pixel width of legend tick labels.
Maximum allowed pixel width of legend tick labels.
Default value: 160
.
- Inherited from
- BaseLegend
The offset of the legend label.
The offset of the legend label.
Default value: 4
.
- Inherited from
- BaseLegend
The strategy to use for resolving overlap of labels in gradient legends. If false
, no overlap reduction is attempted. If set to true
(default) 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).
The strategy to use for resolving overlap of labels in gradient legends. If false
, no overlap reduction is attempted. If set to true
(default) 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: true
.
- Inherited from
- BaseLegend
Padding in pixels between the legend and legend labels.
Padding in pixels between the legend and legend labels.
- Inherited from
- BaseLegend
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.
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.
- Inherited from
- BaseLegend
Custom x-position for legend with orient "none".
Custom x-position for legend with orient "none".
- Inherited from
- BaseLegend
Custom y-position for legend with orient "none".
Custom y-position for legend with orient "none".
- Inherited from
- BaseLegend
The offset in pixels by which to displace the legend from the data rectangle and axes.
The offset in pixels by which to displace the legend from the data rectangle and axes.
Default value: 18
.
- Inherited from
- BaseLegend
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".
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"
- Inherited from
- BaseLegend
The padding between the border and content of the legend group.
The padding between the border and content of the legend group.
Default value: 0
.
- Inherited from
- BaseLegend
The vertical padding in pixels between symbol legend entries.
The vertical padding in pixels between symbol legend entries.
Default value: 2
.
- Inherited from
- BaseLegend
Border stroke color for the full legend.
Border stroke color for the full legend.
- Inherited from
- BaseLegend
An array of alternating [stroke, space] lengths for dashed symbol strokes.
An array of alternating [stroke, space] lengths for dashed symbol strokes.
- Inherited from
- BaseLegend
The pixel offset at which to start drawing with the symbol stroke dash array.
The pixel offset at which to start drawing with the symbol stroke dash array.
- Inherited from
- BaseLegend
The color of the legend symbol,
The color of the legend symbol,
- Inherited from
- BaseLegend
The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.
The maximum number of allowed entries for a symbol legend. Additional entries will be dropped.
- Inherited from
- BaseLegend
Horizontal pixel offset for legend symbols.
Horizontal pixel offset for legend symbols.
Default value: 0
.
- Inherited from
- BaseLegend
Opacity of the legend symbols.
Opacity of the legend symbols.
- Inherited from
- BaseLegend
The size of the legend symbol, in pixels.
The size of the legend symbol, in pixels.
Default value: 100
.
- Inherited from
- BaseLegend
Stroke color for legend symbols.
Stroke color for legend symbols.
- Inherited from
- BaseLegend
The width of the symbol's stroke.
The width of the symbol's stroke.
Default value: 1.5
.
- Inherited from
- BaseLegend
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.
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"
.
- Inherited from
- BaseLegend
The desired number of tick values for quantitative legends.
The desired number of tick values for quantitative legends.
- Inherited from
- BaseLegend
Horizontal text alignment for legend titles.
Horizontal text alignment for legend titles.
Default value: "left"
.
- Inherited from
- BaseLegend
Text anchor position for placing legend titles.
Text anchor position for placing legend titles.
- Inherited from
- BaseLegend
Vertical text baseline for legend titles. One of "alphabetic"
(default), "top"
, "middle"
, "bottom"
, "line-top"
, or "line-bottom"
. The "line-top"
and "line-bottom"
values operate similarly to "top"
and "bottom"
, but are calculated relative to the lineHeight rather than fontSize alone.
Vertical text baseline for legend titles. One of "alphabetic"
(default), "top"
, "middle"
, "bottom"
, "line-top"
, or "line-bottom"
. The "line-top"
and "line-bottom"
values operate similarly to "top"
and "bottom"
, but are calculated relative to the lineHeight rather than fontSize alone.
Default value: "top"
.
- Inherited from
- BaseLegend
The color of the legend title, can be in hex color code or regular color name.
The color of the legend title, can be in hex color code or regular color name.
- Inherited from
- BaseLegend
The font of the legend title.
The font of the legend title.
- Inherited from
- BaseLegend
The font size of the legend title.
The font size of the legend title.
- Inherited from
- BaseLegend
The font style of the legend title.
The font style of the legend title.
- Inherited from
- BaseLegend
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
).
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
).
- Inherited from
- BaseLegend
Maximum allowed pixel width of legend titles.
Maximum allowed pixel width of legend titles.
Default value: 180
.
- Inherited from
- BaseLegend
Line height in pixels for multi-line title text or title text with "line-top"
or "line-bottom"
baseline.
Line height in pixels for multi-line title text or title text with "line-top"
or "line-bottom"
baseline.
- Inherited from
- BaseLegend
Opacity of the legend title.
Opacity of the legend title.
- Inherited from
- BaseLegend
Orientation of the legend title.
Orientation of the legend title.
- Inherited from
- BaseLegend
The padding, in pixels, between title and legend.
The padding, in pixels, between title and legend.
Default value: 5
.
- Inherited from
- BaseLegend
The integer z-index indicating the layering of the legend group relative to other axis, mark, and legend groups.
The integer z-index indicating the layering of the legend group relative to other axis, mark, and legend groups.
- Inherited from
- BaseLegend