Legend

@JSType
trait Legend extends StObject with BaseLegend
Companion
object
trait StObject
class Object
trait Any
class Object
trait Matchable
class Any

Value members

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from
Object
def isPrototypeOf(v: Object): Boolean
Inherited from
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from
Object
def toLocaleString(): String
Inherited from
Object
def valueOf(): Any
Inherited from
Object

Concrete fields

@ExposedJSMember @JSOptional
var `type`: UndefOr[LegendType]

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.

@ExposedJSMember @JSOptional
var direction: UndefOr[Orientation]

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"

@ExposedJSMember @JSOptional
var encode: UndefOr[LegendEncode]

Mark definitions for custom legend encoding.

Mark definitions for custom legend encoding.

@ExposedJSMember @JSOptional
var fill: UndefOr[String]
@ExposedJSMember @JSOptional
var format: UndefOr[String | TimeFormatSpecifier | SignalRef]

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.

@ExposedJSMember @JSOptional

The format type for legend labels (number, time, or utc).

The format type for legend labels (number, time, or utc).

@ExposedJSMember @JSOptional
var opacity: UndefOr[String]
@ExposedJSMember @JSOptional
var shape: UndefOr[String]
@ExposedJSMember @JSOptional
var size: UndefOr[String]
@ExposedJSMember @JSOptional
var stroke: UndefOr[String]
@ExposedJSMember @JSOptional
var strokeDash: UndefOr[String]
@ExposedJSMember @JSOptional
var strokeWidth: UndefOr[String]
@ExposedJSMember @JSOptional
var tickMinStep: UndefOr[Double | SignalRef]

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.

@ExposedJSMember @JSOptional
var title: UndefOr[Text | SignalRef]

The title for the legend.

The title for the legend.

@ExposedJSMember @JSOptional
var values: UndefOr[Array[Any] | SignalRef]

Explicitly set the visible legend values.

Explicitly set the visible legend values.

Inherited fields

@ExposedJSMember @JSOptional
var aria: UndefOr[Boolean]

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
@ExposedJSMember @JSOptional
var clipHeight: UndefOr[Double | SignalRef]

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
@ExposedJSMember @JSOptional
var columnPadding: UndefOr[Double | SignalRef]

The horizontal padding in pixels between symbol legend entries.

The horizontal padding in pixels between symbol legend entries.

Default value: 10.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var columns: UndefOr[Double | SignalRef]

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
@ExposedJSMember @JSOptional

Corner radius for the full legend.

Corner radius for the full legend.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var description: UndefOr[String]

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
@ExposedJSMember @JSOptional
var fillColor: UndefOr[ColorValue]

Background fill color for the full legend.

Background fill color for the full legend.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var gradientLength: UndefOr[Double | SignalRef]

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
@ExposedJSMember @JSOptional

Opacity of the color gradient.

Opacity of the color gradient.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional

The width of the gradient stroke, in pixels.

The width of the gradient stroke, in pixels.

Default value: 0.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var gradientThickness: UndefOr[Double | SignalRef]

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
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional
var labelAlign: UndefOr[AlignValue]

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
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional
var labelColor: UndefOr[ColorValue]

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
@ExposedJSMember @JSOptional
var labelFont: UndefOr[StringValue]

The font of the legend label.

The font of the legend label.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

The font size of legend label.

The font size of legend label.

Default value: 10.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

The font style of legend label.

The font style of legend label.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

The font weight of legend label.

The font weight of legend label.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var labelLimit: UndefOr[NumberValue]

Maximum allowed pixel width of legend tick labels.

Maximum allowed pixel width of legend tick labels.

Default value: 160.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var labelOffset: UndefOr[NumberValue]

The offset of the legend label.

The offset of the legend label.

Default value: 4.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

Opacity of labels.

Opacity of labels.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional

Padding in pixels between the legend and legend labels.

Padding in pixels between the legend and legend labels.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var labelSeparation: UndefOr[Double | SignalRef]

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
@ExposedJSMember @JSOptional
var legendX: UndefOr[NumberValue]

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

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

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var legendY: UndefOr[NumberValue]

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

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

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var offset: UndefOr[NumberValue]

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
@ExposedJSMember @JSOptional
var orient: UndefOr[LegendOrient | SignalRef]

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
@ExposedJSMember @JSOptional
var padding: UndefOr[NumberValue]

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
@ExposedJSMember @JSOptional
var rowPadding: UndefOr[Double | SignalRef]

The vertical padding in pixels between symbol legend entries.

The vertical padding in pixels between symbol legend entries.

Default value: 2.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var strokeColor: UndefOr[ColorValue]

Border stroke color for the full legend.

Border stroke color for the full legend.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional

The color of the legend symbol,

The color of the legend symbol,

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var symbolLimit: UndefOr[NumberValue]

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
@ExposedJSMember @JSOptional

Horizontal pixel offset for legend symbols.

Horizontal pixel offset for legend symbols.

Default value: 0.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

Opacity of the legend symbols.

Opacity of the legend symbols.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var symbolSize: UndefOr[NumberValue]

The size of the legend symbol, in pixels.

The size of the legend symbol, in pixels.

Default value: 100.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

Stroke color for legend symbols.

Stroke color for legend symbols.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

The width of the symbol's stroke.

The width of the symbol's stroke.

Default value: 1.5.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional
var tickCount: UndefOr[TickCount]

The desired number of tick values for quantitative legends.

The desired number of tick values for quantitative legends.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var titleAlign: UndefOr[AlignValue]

Horizontal text alignment for legend titles.

Horizontal text alignment for legend titles.

Default value: "left".

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var titleAnchor: UndefOr[AnchorValue]

Text anchor position for placing legend titles.

Text anchor position for placing legend titles.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional
var titleColor: UndefOr[ColorValue]

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
@ExposedJSMember @JSOptional
var titleFont: UndefOr[StringValue]

The font of the legend title.

The font of the legend title.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

The font size of the legend title.

The font size of the legend title.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

The font style of the legend title.

The font style of the legend title.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional
var titleLimit: UndefOr[NumberValue]

Maximum allowed pixel width of legend titles.

Maximum allowed pixel width of legend titles.

Default value: 180.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

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
@ExposedJSMember @JSOptional

Opacity of the legend title.

Opacity of the legend title.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var titleOrient: UndefOr[OrientValue]

Orientation of the legend title.

Orientation of the legend title.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional

The padding, in pixels, between title and legend.

The padding, in pixels, between title and legend.

Default value: 5.

Inherited from
BaseLegend
@ExposedJSMember @JSOptional
var zindex: UndefOr[Double]

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