altair.LegendConfig

class altair.LegendConfig(aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, disable=Undefined, fillColor=Undefined, gradientDirection=Undefined, gradientHorizontalMaxLength=Undefined, gradientHorizontalMinLength=Undefined, gradientLabelLimit=Undefined, gradientLabelOffset=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gradientVerticalMaxLength=Undefined, gradientVerticalMinLength=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, layout=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, strokeDash=Undefined, strokeWidth=Undefined, symbolBaseFillColor=Undefined, symbolBaseStrokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolDirection=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, unselectedOpacity=Undefined, zindex=Undefined, **kwds)

LegendConfig schema wrapper

Mapping(required=[])

Attributes
ariaanyOf(boolean, ExprRef)
clipHeightanyOf(float, ExprRef)
columnPaddinganyOf(float, ExprRef)
columnsanyOf(float, ExprRef)
cornerRadiusanyOf(float, ExprRef)
descriptionanyOf(string, ExprRef)
directionOrientation

The direction of the legend, one of "vertical" or "horizontal".

Default value: - For top-/bottom- orient ed legends, "horizontal" - For left-/right- orient ed legends, "vertical" - For top/bottom-left/right- orient ed legends, "horizontal" for gradient legends and "vertical" for symbol legends.

disableboolean

Disable legend by default

fillColoranyOf(anyOf(None, Color), ExprRef)
gradientDirectionanyOf(Orientation, ExprRef)
gradientHorizontalMaxLengthfloat

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

Default value: 200

gradientHorizontalMinLengthfloat

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

Default value: 100

gradientLabelLimitanyOf(float, ExprRef)
gradientLabelOffsetanyOf(float, ExprRef)
gradientLengthanyOf(float, ExprRef)
gradientOpacityanyOf(float, ExprRef)
gradientStrokeColoranyOf(anyOf(None, Color), ExprRef)
gradientStrokeWidthanyOf(float, ExprRef)
gradientThicknessanyOf(float, ExprRef)
gradientVerticalMaxLengthfloat

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

Default value: 200

gradientVerticalMinLengthfloat

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

Default value: 100

gridAlignanyOf(LayoutAlign, ExprRef)
labelAlignanyOf(Align, ExprRef)
labelBaselineanyOf(TextBaseline, ExprRef)
labelColoranyOf(anyOf(None, Color), ExprRef)
labelFontanyOf(string, ExprRef)
labelFontSizeanyOf(float, ExprRef)
labelFontStyleanyOf(FontStyle, ExprRef)
labelFontWeightanyOf(FontWeight, ExprRef)
labelLimitanyOf(float, ExprRef)
labelOffsetanyOf(float, ExprRef)
labelOpacityanyOf(float, ExprRef)
labelOverlapanyOf(LabelOverlap, ExprRef)

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`.

labelPaddinganyOf(float, ExprRef)
labelSeparationanyOf(float, ExprRef)
layoutExprRef
legendXanyOf(float, ExprRef)
legendYanyOf(float, ExprRef)
offsetanyOf(float, ExprRef)
orientLegendOrient

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

Default value: "right"

paddinganyOf(float, ExprRef)
rowPaddinganyOf(float, ExprRef)
strokeColoranyOf(anyOf(None, Color), ExprRef)
strokeDashanyOf(List(float), ExprRef)
strokeWidthanyOf(float, ExprRef)
symbolBaseFillColoranyOf(anyOf(None, Color), ExprRef)
symbolBaseStrokeColoranyOf(anyOf(None, Color), ExprRef)
symbolDashanyOf(List(float), ExprRef)
symbolDashOffsetanyOf(float, ExprRef)
symbolDirectionanyOf(Orientation, ExprRef)
symbolFillColoranyOf(anyOf(None, Color), ExprRef)
symbolLimitanyOf(float, ExprRef)
symbolOffsetanyOf(float, ExprRef)
symbolOpacityanyOf(float, ExprRef)
symbolSizeanyOf(float, ExprRef)
symbolStrokeColoranyOf(anyOf(None, Color), ExprRef)
symbolStrokeWidthanyOf(float, ExprRef)
symbolTypeanyOf(SymbolShape, ExprRef)
tickCountanyOf(TickCount, ExprRef)
titleNone

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

titleAlignanyOf(Align, ExprRef)
titleAnchoranyOf(TitleAnchor, ExprRef)
titleBaselineanyOf(TextBaseline, ExprRef)
titleColoranyOf(anyOf(None, Color), ExprRef)
titleFontanyOf(string, ExprRef)
titleFontSizeanyOf(float, ExprRef)
titleFontStyleanyOf(FontStyle, ExprRef)
titleFontWeightanyOf(FontWeight, ExprRef)
titleLimitanyOf(float, ExprRef)
titleLineHeightanyOf(float, ExprRef)
titleOpacityanyOf(float, ExprRef)
titleOrientanyOf(Orient, ExprRef)
titlePaddinganyOf(float, ExprRef)
unselectedOpacityfloat

The opacity of unselected legend entries.

Default value: 0.35.

zindexanyOf(float, ExprRef)
__init__(aria=Undefined, clipHeight=Undefined, columnPadding=Undefined, columns=Undefined, cornerRadius=Undefined, description=Undefined, direction=Undefined, disable=Undefined, fillColor=Undefined, gradientDirection=Undefined, gradientHorizontalMaxLength=Undefined, gradientHorizontalMinLength=Undefined, gradientLabelLimit=Undefined, gradientLabelOffset=Undefined, gradientLength=Undefined, gradientOpacity=Undefined, gradientStrokeColor=Undefined, gradientStrokeWidth=Undefined, gradientThickness=Undefined, gradientVerticalMaxLength=Undefined, gradientVerticalMinLength=Undefined, gridAlign=Undefined, labelAlign=Undefined, labelBaseline=Undefined, labelColor=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, layout=Undefined, legendX=Undefined, legendY=Undefined, offset=Undefined, orient=Undefined, padding=Undefined, rowPadding=Undefined, strokeColor=Undefined, strokeDash=Undefined, strokeWidth=Undefined, symbolBaseFillColor=Undefined, symbolBaseStrokeColor=Undefined, symbolDash=Undefined, symbolDashOffset=Undefined, symbolDirection=Undefined, symbolFillColor=Undefined, symbolLimit=Undefined, symbolOffset=Undefined, symbolOpacity=Undefined, symbolSize=Undefined, symbolStrokeColor=Undefined, symbolStrokeWidth=Undefined, symbolType=Undefined, tickCount=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titleOrient=Undefined, titlePadding=Undefined, unselectedOpacity=Undefined, zindex=Undefined, **kwds)

Methods

__init__([aria, clipHeight, columnPadding, ...])

copy([deep, ignore])

Return a copy of the object

from_dict(dct[, validate, _wrapper_classes])

Construct class from a dictionary representation

from_json(json_string[, validate])

Instantiate the object from a valid JSON string

resolve_references([schema])

Resolve references in the context of this object's schema or root schema.

to_dict([validate, ignore, context])

Return a dictionary representation of the object

to_json([validate, ignore, context, indent, ...])

Emit the JSON representation for this object as a string.

validate(instance[, schema])

Validate the instance against the class schema in the context of the rootschema.

validate_property(name, value[, schema])

Validate a property against property schema in the context of the rootschema