altair.Axis#
- class altair.Axis(aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, translate=Undefined, values=Undefined, zindex=Undefined, **kwds)#
Axis schema wrapper.
- Parameters:
- ariabool, dict,
ExprRef
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 axis from the ARIA accessibility tree.Default value:
true
- bandPositiondict, float,
ExprRef
An interpolation fraction indicating where, for
band
scales, axis ticks should be positioned. A value of0
places ticks at the left edge of their bands. A value of0.5
places ticks in the middle of their bands.Default value:
0.5
- descriptionstr, dict,
ExprRef
A text description of this axis 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.- domainbool
A boolean flag indicating if the domain (the axis baseline) should be included as part of the axis.
Default value:
true
- domainCapdict,
ExprRef
,StrokeCap
, Literal[‘butt’, ‘round’, ‘square’] The stroke cap for the domain line’s ending style. One of
"butt"
,"round"
or"square"
.Default value:
"butt"
- domainColorstr, dict, None,
Color
,ExprRef
,HexColor
,ColorName
, Literal[‘black’, ‘silver’, ‘gray’, ‘white’, ‘maroon’, ‘red’, ‘purple’, ‘fuchsia’, ‘green’, ‘lime’, ‘olive’, ‘yellow’, ‘navy’, ‘blue’, ‘teal’, ‘aqua’, ‘orange’, ‘aliceblue’, ‘antiquewhite’, ‘aquamarine’, ‘azure’, ‘beige’, ‘bisque’, ‘blanchedalmond’, ‘blueviolet’, ‘brown’, ‘burlywood’, ‘cadetblue’, ‘chartreuse’, ‘chocolate’, ‘coral’, ‘cornflowerblue’, ‘cornsilk’, ‘crimson’, ‘cyan’, ‘darkblue’, ‘darkcyan’, ‘darkgoldenrod’, ‘darkgray’, ‘darkgreen’, ‘darkgrey’, ‘darkkhaki’, ‘darkmagenta’, ‘darkolivegreen’, ‘darkorange’, ‘darkorchid’, ‘darkred’, ‘darksalmon’, ‘darkseagreen’, ‘darkslateblue’, ‘darkslategray’, ‘darkslategrey’, ‘darkturquoise’, ‘darkviolet’, ‘deeppink’, ‘deepskyblue’, ‘dimgray’, ‘dimgrey’, ‘dodgerblue’, ‘firebrick’, ‘floralwhite’, ‘forestgreen’, ‘gainsboro’, ‘ghostwhite’, ‘gold’, ‘goldenrod’, ‘greenyellow’, ‘grey’, ‘honeydew’, ‘hotpink’, ‘indianred’, ‘indigo’, ‘ivory’, ‘khaki’, ‘lavender’, ‘lavenderblush’, ‘lawngreen’, ‘lemonchiffon’, ‘lightblue’, ‘lightcoral’, ‘lightcyan’, ‘lightgoldenrodyellow’, ‘lightgray’, ‘lightgreen’, ‘lightgrey’, ‘lightpink’, ‘lightsalmon’, ‘lightseagreen’, ‘lightskyblue’, ‘lightslategray’, ‘lightslategrey’, ‘lightsteelblue’, ‘lightyellow’, ‘limegreen’, ‘linen’, ‘magenta’, ‘mediumaquamarine’, ‘mediumblue’, ‘mediumorchid’, ‘mediumpurple’, ‘mediumseagreen’, ‘mediumslateblue’, ‘mediumspringgreen’, ‘mediumturquoise’, ‘mediumvioletred’, ‘midnightblue’, ‘mintcream’, ‘mistyrose’, ‘moccasin’, ‘navajowhite’, ‘oldlace’, ‘olivedrab’, ‘orangered’, ‘orchid’, ‘palegoldenrod’, ‘palegreen’, ‘paleturquoise’, ‘palevioletred’, ‘papayawhip’, ‘peachpuff’, ‘peru’, ‘pink’, ‘plum’, ‘powderblue’, ‘rosybrown’, ‘royalblue’, ‘saddlebrown’, ‘salmon’, ‘sandybrown’, ‘seagreen’, ‘seashell’, ‘sienna’, ‘skyblue’, ‘slateblue’, ‘slategray’, ‘slategrey’, ‘snow’, ‘springgreen’, ‘steelblue’, ‘tan’, ‘thistle’, ‘tomato’, ‘turquoise’, ‘violet’, ‘wheat’, ‘whitesmoke’, ‘yellowgreen’, ‘rebeccapurple’] Color of axis domain line.
Default value:
"gray"
.- domainDashdict, Sequence[float],
ExprRef
An array of alternating [stroke, space] lengths for dashed domain lines.
- domainDashOffsetdict, float,
ExprRef
The pixel offset at which to start drawing with the domain dash array.
- domainOpacitydict, float,
ExprRef
Opacity of the axis domain line.
- domainWidthdict, float,
ExprRef
Stroke width of axis domain line
Default value:
1
- formatstr, dict,
Dict
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
alongsidedatum.value
to the registered function.Default value: Derived from numberFormat config for number format and from timeFormat config for time format.
- formatTypestr
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 withtimeUnit
."number"
for quantitative fields as well as ordinal and nominal fields withouttimeUnit
.
- gridbool
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
.- gridCapdict,
ExprRef
,StrokeCap
, Literal[‘butt’, ‘round’, ‘square’] The stroke cap for grid lines’ ending style. One of
"butt"
,"round"
or"square"
.Default value:
"butt"
- gridColorstr, dict, None,
Color
,ExprRef
,HexColor
,ColorName
,ConditionalAxisColor
, Literal[‘black’, ‘silver’, ‘gray’, ‘white’, ‘maroon’, ‘red’, ‘purple’, ‘fuchsia’, ‘green’, ‘lime’, ‘olive’, ‘yellow’, ‘navy’, ‘blue’, ‘teal’, ‘aqua’, ‘orange’, ‘aliceblue’, ‘antiquewhite’, ‘aquamarine’, ‘azure’, ‘beige’, ‘bisque’, ‘blanchedalmond’, ‘blueviolet’, ‘brown’, ‘burlywood’, ‘cadetblue’, ‘chartreuse’, ‘chocolate’, ‘coral’, ‘cornflowerblue’, ‘cornsilk’, ‘crimson’, ‘cyan’, ‘darkblue’, ‘darkcyan’, ‘darkgoldenrod’, ‘darkgray’, ‘darkgreen’, ‘darkgrey’, ‘darkkhaki’, ‘darkmagenta’, ‘darkolivegreen’, ‘darkorange’, ‘darkorchid’, ‘darkred’, ‘darksalmon’, ‘darkseagreen’, ‘darkslateblue’, ‘darkslategray’, ‘darkslategrey’, ‘darkturquoise’, ‘darkviolet’, ‘deeppink’, ‘deepskyblue’, ‘dimgray’, ‘dimgrey’, ‘dodgerblue’, ‘firebrick’, ‘floralwhite’, ‘forestgreen’, ‘gainsboro’, ‘ghostwhite’, ‘gold’, ‘goldenrod’, ‘greenyellow’, ‘grey’, ‘honeydew’, ‘hotpink’, ‘indianred’, ‘indigo’, ‘ivory’, ‘khaki’, ‘lavender’, ‘lavenderblush’, ‘lawngreen’, ‘lemonchiffon’, ‘lightblue’, ‘lightcoral’, ‘lightcyan’, ‘lightgoldenrodyellow’, ‘lightgray’, ‘lightgreen’, ‘lightgrey’, ‘lightpink’, ‘lightsalmon’, ‘lightseagreen’, ‘lightskyblue’, ‘lightslategray’, ‘lightslategrey’, ‘lightsteelblue’, ‘lightyellow’, ‘limegreen’, ‘linen’, ‘magenta’, ‘mediumaquamarine’, ‘mediumblue’, ‘mediumorchid’, ‘mediumpurple’, ‘mediumseagreen’, ‘mediumslateblue’, ‘mediumspringgreen’, ‘mediumturquoise’, ‘mediumvioletred’, ‘midnightblue’, ‘mintcream’, ‘mistyrose’, ‘moccasin’, ‘navajowhite’, ‘oldlace’, ‘olivedrab’, ‘orangered’, ‘orchid’, ‘palegoldenrod’, ‘palegreen’, ‘paleturquoise’, ‘palevioletred’, ‘papayawhip’, ‘peachpuff’, ‘peru’, ‘pink’, ‘plum’, ‘powderblue’, ‘rosybrown’, ‘royalblue’, ‘saddlebrown’, ‘salmon’, ‘sandybrown’, ‘seagreen’, ‘seashell’, ‘sienna’, ‘skyblue’, ‘slateblue’, ‘slategray’, ‘slategrey’, ‘snow’, ‘springgreen’, ‘steelblue’, ‘tan’, ‘thistle’, ‘tomato’, ‘turquoise’, ‘violet’, ‘wheat’, ‘whitesmoke’, ‘yellowgreen’, ‘rebeccapurple’] Color of gridlines.
Default value:
"lightGray"
.- gridDashdict, Sequence[float],
ExprRef
,ConditionalAxisNumberArray
An array of alternating [stroke, space] lengths for dashed grid lines.
- gridDashOffsetdict, float,
ExprRef
,ConditionalAxisNumber
The pixel offset at which to start drawing with the grid dash array.
- gridOpacitydict, float,
ExprRef
,ConditionalAxisNumber
The stroke opacity of grid (value between [0,1])
Default value:
1
- gridWidthdict, float,
ExprRef
,ConditionalAxisNumber
The grid width, in pixels.
Default value:
1
- labelAligndict,
Align
,ExprRef
,ConditionalAxisLabelAlign
, Literal[‘left’, ‘center’, ‘right’] Horizontal text alignment of axis tick labels, overriding the default setting for the current axis orientation.
- labelAngledict, float,
ExprRef
The rotation angle of the axis labels.
Default value:
-90
for nominal and ordinal fields;0
otherwise.- labelBaselinedict,
ExprRef
,Baseline
,TextBaseline
,ConditionalAxisLabelBaseline
, Literal[‘alphabetic’, ‘line-bottom’, ‘line-top’, ‘top’, ‘middle’, ‘bottom’] Vertical text baseline of axis tick labels, overriding the default setting for the current axis orientation. 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.- labelBoundbool, dict, float,
ExprRef
Indicates if labels should be hidden if they exceed the axis range. If
false
(the default) no bounds overlap analysis is performed. Iftrue
, 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
.- labelColorstr, dict, None,
Color
,ExprRef
,HexColor
,ColorName
,ConditionalAxisColor
, Literal[‘black’, ‘silver’, ‘gray’, ‘white’, ‘maroon’, ‘red’, ‘purple’, ‘fuchsia’, ‘green’, ‘lime’, ‘olive’, ‘yellow’, ‘navy’, ‘blue’, ‘teal’, ‘aqua’, ‘orange’, ‘aliceblue’, ‘antiquewhite’, ‘aquamarine’, ‘azure’, ‘beige’, ‘bisque’, ‘blanchedalmond’, ‘blueviolet’, ‘brown’, ‘burlywood’, ‘cadetblue’, ‘chartreuse’, ‘chocolate’, ‘coral’, ‘cornflowerblue’, ‘cornsilk’, ‘crimson’, ‘cyan’, ‘darkblue’, ‘darkcyan’, ‘darkgoldenrod’, ‘darkgray’, ‘darkgreen’, ‘darkgrey’, ‘darkkhaki’, ‘darkmagenta’, ‘darkolivegreen’, ‘darkorange’, ‘darkorchid’, ‘darkred’, ‘darksalmon’, ‘darkseagreen’, ‘darkslateblue’, ‘darkslategray’, ‘darkslategrey’, ‘darkturquoise’, ‘darkviolet’, ‘deeppink’, ‘deepskyblue’, ‘dimgray’, ‘dimgrey’, ‘dodgerblue’, ‘firebrick’, ‘floralwhite’, ‘forestgreen’, ‘gainsboro’, ‘ghostwhite’, ‘gold’, ‘goldenrod’, ‘greenyellow’, ‘grey’, ‘honeydew’, ‘hotpink’, ‘indianred’, ‘indigo’, ‘ivory’, ‘khaki’, ‘lavender’, ‘lavenderblush’, ‘lawngreen’, ‘lemonchiffon’, ‘lightblue’, ‘lightcoral’, ‘lightcyan’, ‘lightgoldenrodyellow’, ‘lightgray’, ‘lightgreen’, ‘lightgrey’, ‘lightpink’, ‘lightsalmon’, ‘lightseagreen’, ‘lightskyblue’, ‘lightslategray’, ‘lightslategrey’, ‘lightsteelblue’, ‘lightyellow’, ‘limegreen’, ‘linen’, ‘magenta’, ‘mediumaquamarine’, ‘mediumblue’, ‘mediumorchid’, ‘mediumpurple’, ‘mediumseagreen’, ‘mediumslateblue’, ‘mediumspringgreen’, ‘mediumturquoise’, ‘mediumvioletred’, ‘midnightblue’, ‘mintcream’, ‘mistyrose’, ‘moccasin’, ‘navajowhite’, ‘oldlace’, ‘olivedrab’, ‘orangered’, ‘orchid’, ‘palegoldenrod’, ‘palegreen’, ‘paleturquoise’, ‘palevioletred’, ‘papayawhip’, ‘peachpuff’, ‘peru’, ‘pink’, ‘plum’, ‘powderblue’, ‘rosybrown’, ‘royalblue’, ‘saddlebrown’, ‘salmon’, ‘sandybrown’, ‘seagreen’, ‘seashell’, ‘sienna’, ‘skyblue’, ‘slateblue’, ‘slategray’, ‘slategrey’, ‘snow’, ‘springgreen’, ‘steelblue’, ‘tan’, ‘thistle’, ‘tomato’, ‘turquoise’, ‘violet’, ‘wheat’, ‘whitesmoke’, ‘yellowgreen’, ‘rebeccapurple’] The color of the tick label, can be in hex color code or regular color name.
- labelExprstr
Vega expression for customizing labels.
Note: The label text and value can be assessed via the
label
andvalue
properties of the axis’s backingdatum
object.- labelFlushbool, float
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
.- labelFlushOffsetdict, float,
ExprRef
Indicates the number of pixels by which to offset flush-adjusted labels. For example, a value of
2
will push flush-adjusted labels 2 pixels outward from the center of the axis. Offsets can help the labels better visually group with corresponding axis ticks.Default value:
0
.- labelFontstr, dict,
ExprRef
,ConditionalAxisString
The font of the tick label.
- labelFontSizedict, float,
ExprRef
,ConditionalAxisNumber
The font size of the label, in pixels.
- labelFontStylestr, dict,
ExprRef
,FontStyle
,ConditionalAxisLabelFontStyle
Font style of the title.
- labelFontWeightdict,
ExprRef
,FontWeight
,ConditionalAxisLabelFontWeight
, Literal[‘normal’, ‘bold’, ‘lighter’, ‘bolder’, 100, 200, 300, 400, 500, 600, 700, 800, 900] Font weight of axis tick labels.
- labelLimitdict, float,
ExprRef
Maximum allowed pixel width of axis tick labels.
Default value:
180
- labelLineHeightdict, float,
ExprRef
Line height in pixels for multi-line label text or label text with
"line-top"
or"line-bottom"
baseline.- labelOffsetdict, float,
ExprRef
,ConditionalAxisNumber
Position offset in pixels to apply to labels, in addition to tickOffset.
Default value:
0
- labelOpacitydict, float,
ExprRef
,ConditionalAxisNumber
The opacity of the labels.
- labelOverlapbool, dict,
ExprRef
,LabelOverlap
, Literal[‘greedy’, ‘parity’] The strategy to use for resolving overlap of axis labels. If
false
(the default), no overlap reduction is attempted. If set totrue
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; otherwisefalse
.- labelPaddingdict, float,
ExprRef
,ConditionalAxisNumber
The padding in pixels between labels and ticks.
Default value:
2
- labelSeparationdict, float,
ExprRef
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.- labelsbool
A boolean flag indicating if labels should be included as part of the axis.
Default value:
true
.- maxExtentdict, float,
ExprRef
The maximum extent in pixels that axis ticks and labels should use. This determines a maximum offset value for axis titles.
Default value:
undefined
.- minExtentdict, float,
ExprRef
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.- offsetdict, float,
ExprRef
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)- orientdict,
ExprRef
,AxisOrient
, Literal[‘top’, ‘bottom’, ‘left’, ‘right’] 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.- positiondict, float,
ExprRef
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
- stylestr, Sequence[str]
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 useconfig.axisX
andconfig.style.foo
(the specified style"foo"
has higher precedence).- tickBanddict,
ExprRef
, Literal[‘center’, ‘extent’] For band scales, indicates if ticks and grid lines should be placed at the
"center"
of a band (default) or at the band ``”extent”``s to indicate intervals- tickCapdict,
ExprRef
,StrokeCap
, Literal[‘butt’, ‘round’, ‘square’] The stroke cap for the tick lines’ ending style. One of
"butt"
,"round"
or"square"
.Default value:
"butt"
- tickColorstr, dict, None,
Color
,ExprRef
,HexColor
,ColorName
,ConditionalAxisColor
, Literal[‘black’, ‘silver’, ‘gray’, ‘white’, ‘maroon’, ‘red’, ‘purple’, ‘fuchsia’, ‘green’, ‘lime’, ‘olive’, ‘yellow’, ‘navy’, ‘blue’, ‘teal’, ‘aqua’, ‘orange’, ‘aliceblue’, ‘antiquewhite’, ‘aquamarine’, ‘azure’, ‘beige’, ‘bisque’, ‘blanchedalmond’, ‘blueviolet’, ‘brown’, ‘burlywood’, ‘cadetblue’, ‘chartreuse’, ‘chocolate’, ‘coral’, ‘cornflowerblue’, ‘cornsilk’, ‘crimson’, ‘cyan’, ‘darkblue’, ‘darkcyan’, ‘darkgoldenrod’, ‘darkgray’, ‘darkgreen’, ‘darkgrey’, ‘darkkhaki’, ‘darkmagenta’, ‘darkolivegreen’, ‘darkorange’, ‘darkorchid’, ‘darkred’, ‘darksalmon’, ‘darkseagreen’, ‘darkslateblue’, ‘darkslategray’, ‘darkslategrey’, ‘darkturquoise’, ‘darkviolet’, ‘deeppink’, ‘deepskyblue’, ‘dimgray’, ‘dimgrey’, ‘dodgerblue’, ‘firebrick’, ‘floralwhite’, ‘forestgreen’, ‘gainsboro’, ‘ghostwhite’, ‘gold’, ‘goldenrod’, ‘greenyellow’, ‘grey’, ‘honeydew’, ‘hotpink’, ‘indianred’, ‘indigo’, ‘ivory’, ‘khaki’, ‘lavender’, ‘lavenderblush’, ‘lawngreen’, ‘lemonchiffon’, ‘lightblue’, ‘lightcoral’, ‘lightcyan’, ‘lightgoldenrodyellow’, ‘lightgray’, ‘lightgreen’, ‘lightgrey’, ‘lightpink’, ‘lightsalmon’, ‘lightseagreen’, ‘lightskyblue’, ‘lightslategray’, ‘lightslategrey’, ‘lightsteelblue’, ‘lightyellow’, ‘limegreen’, ‘linen’, ‘magenta’, ‘mediumaquamarine’, ‘mediumblue’, ‘mediumorchid’, ‘mediumpurple’, ‘mediumseagreen’, ‘mediumslateblue’, ‘mediumspringgreen’, ‘mediumturquoise’, ‘mediumvioletred’, ‘midnightblue’, ‘mintcream’, ‘mistyrose’, ‘moccasin’, ‘navajowhite’, ‘oldlace’, ‘olivedrab’, ‘orangered’, ‘orchid’, ‘palegoldenrod’, ‘palegreen’, ‘paleturquoise’, ‘palevioletred’, ‘papayawhip’, ‘peachpuff’, ‘peru’, ‘pink’, ‘plum’, ‘powderblue’, ‘rosybrown’, ‘royalblue’, ‘saddlebrown’, ‘salmon’, ‘sandybrown’, ‘seagreen’, ‘seashell’, ‘sienna’, ‘skyblue’, ‘slateblue’, ‘slategray’, ‘slategrey’, ‘snow’, ‘springgreen’, ‘steelblue’, ‘tan’, ‘thistle’, ‘tomato’, ‘turquoise’, ‘violet’, ‘wheat’, ‘whitesmoke’, ‘yellowgreen’, ‘rebeccapurple’] The color of the axis’s tick.
Default value:
"gray"
- tickCountdict, float,
ExprRef
,TimeInterval
,TimeIntervalStep
, Literal[‘millisecond’, ‘second’, ‘minute’, ‘hour’, ‘day’, ‘week’, ‘month’, ‘year’] 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 andceil(height/40)
for y.- tickDashdict, Sequence[float],
ExprRef
,ConditionalAxisNumberArray
An array of alternating [stroke, space] lengths for dashed tick mark lines.
- tickDashOffsetdict, float,
ExprRef
,ConditionalAxisNumber
The pixel offset at which to start drawing with the tick mark dash array.
- tickExtrabool
Boolean flag indicating if an extra axis tick should be added for the initial position of the axis. This flag is useful for styling axes for
band
scales such that ticks are placed on band boundaries rather in the middle of a band. Use in conjunction with"bandPosition": 1
and an axis"padding"
value of0
.- tickMinStepdict, float,
ExprRef
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. IftickMinStep
is specified, thetickCount
value will be adjusted, if necessary, to enforce the minimum step value.- tickOffsetdict, float,
ExprRef
Position offset in pixels to apply to ticks, labels, and gridlines.
- tickOpacitydict, float,
ExprRef
,ConditionalAxisNumber
Opacity of the ticks.
- tickRoundbool
Boolean flag indicating if pixel position values should be rounded to the nearest integer.
Default value:
true
- tickSizedict, float,
ExprRef
,ConditionalAxisNumber
The size in pixels of axis ticks.
Default value:
5
- tickWidthdict, float,
ExprRef
,ConditionalAxisNumber
The width, in pixels, of ticks.
Default value:
1
- ticksbool
Boolean value that determines whether the axis should include ticks.
Default value:
true
- titlestr, None,
Text
, Sequence[str] 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
andtimeUnit
). 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:
1) You can customize the default field title format by providing the fieldTitle property in the config or fieldTitle function via the compile function’s options.
2) If both field definition’s
title
and axis, header, or legendtitle
are defined, axis/header/legend title will be used.- titleAligndict,
Align
,ExprRef
, Literal[‘left’, ‘center’, ‘right’] Horizontal text alignment of axis titles.
- titleAnchordict,
ExprRef
,TitleAnchor
, Literal[None, ‘start’, ‘middle’, ‘end’] Text anchor position for placing axis titles.
- titleAngledict, float,
ExprRef
Angle in degrees of axis titles.
- titleBaselinedict,
ExprRef
,Baseline
,TextBaseline
, Literal[‘alphabetic’, ‘line-bottom’, ‘line-top’, ‘top’, ‘middle’, ‘bottom’] Vertical text baseline for axis 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.- titleColorstr, dict, None,
Color
,ExprRef
,HexColor
,ColorName
, Literal[‘black’, ‘silver’, ‘gray’, ‘white’, ‘maroon’, ‘red’, ‘purple’, ‘fuchsia’, ‘green’, ‘lime’, ‘olive’, ‘yellow’, ‘navy’, ‘blue’, ‘teal’, ‘aqua’, ‘orange’, ‘aliceblue’, ‘antiquewhite’, ‘aquamarine’, ‘azure’, ‘beige’, ‘bisque’, ‘blanchedalmond’, ‘blueviolet’, ‘brown’, ‘burlywood’, ‘cadetblue’, ‘chartreuse’, ‘chocolate’, ‘coral’, ‘cornflowerblue’, ‘cornsilk’, ‘crimson’, ‘cyan’, ‘darkblue’, ‘darkcyan’, ‘darkgoldenrod’, ‘darkgray’, ‘darkgreen’, ‘darkgrey’, ‘darkkhaki’, ‘darkmagenta’, ‘darkolivegreen’, ‘darkorange’, ‘darkorchid’, ‘darkred’, ‘darksalmon’, ‘darkseagreen’, ‘darkslateblue’, ‘darkslategray’, ‘darkslategrey’, ‘darkturquoise’, ‘darkviolet’, ‘deeppink’, ‘deepskyblue’, ‘dimgray’, ‘dimgrey’, ‘dodgerblue’, ‘firebrick’, ‘floralwhite’, ‘forestgreen’, ‘gainsboro’, ‘ghostwhite’, ‘gold’, ‘goldenrod’, ‘greenyellow’, ‘grey’, ‘honeydew’, ‘hotpink’, ‘indianred’, ‘indigo’, ‘ivory’, ‘khaki’, ‘lavender’, ‘lavenderblush’, ‘lawngreen’, ‘lemonchiffon’, ‘lightblue’, ‘lightcoral’, ‘lightcyan’, ‘lightgoldenrodyellow’, ‘lightgray’, ‘lightgreen’, ‘lightgrey’, ‘lightpink’, ‘lightsalmon’, ‘lightseagreen’, ‘lightskyblue’, ‘lightslategray’, ‘lightslategrey’, ‘lightsteelblue’, ‘lightyellow’, ‘limegreen’, ‘linen’, ‘magenta’, ‘mediumaquamarine’, ‘mediumblue’, ‘mediumorchid’, ‘mediumpurple’, ‘mediumseagreen’, ‘mediumslateblue’, ‘mediumspringgreen’, ‘mediumturquoise’, ‘mediumvioletred’, ‘midnightblue’, ‘mintcream’, ‘mistyrose’, ‘moccasin’, ‘navajowhite’, ‘oldlace’, ‘olivedrab’, ‘orangered’, ‘orchid’, ‘palegoldenrod’, ‘palegreen’, ‘paleturquoise’, ‘palevioletred’, ‘papayawhip’, ‘peachpuff’, ‘peru’, ‘pink’, ‘plum’, ‘powderblue’, ‘rosybrown’, ‘royalblue’, ‘saddlebrown’, ‘salmon’, ‘sandybrown’, ‘seagreen’, ‘seashell’, ‘sienna’, ‘skyblue’, ‘slateblue’, ‘slategray’, ‘slategrey’, ‘snow’, ‘springgreen’, ‘steelblue’, ‘tan’, ‘thistle’, ‘tomato’, ‘turquoise’, ‘violet’, ‘wheat’, ‘whitesmoke’, ‘yellowgreen’, ‘rebeccapurple’] Color of the title, can be in hex color code or regular color name.
- titleFontstr, dict,
ExprRef
Font of the title. (e.g.,
"Helvetica Neue"
).- titleFontSizedict, float,
ExprRef
Font size of the title.
- titleFontStylestr, dict,
ExprRef
,FontStyle
Font style of the title.
- titleFontWeightdict,
ExprRef
,FontWeight
, Literal[‘normal’, ‘bold’, ‘lighter’, ‘bolder’, 100, 200, 300, 400, 500, 600, 700, 800, 900] 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
).- titleLimitdict, float,
ExprRef
Maximum allowed pixel width of axis titles.
- titleLineHeightdict, float,
ExprRef
Line height in pixels for multi-line title text or title text with
"line-top"
or"line-bottom"
baseline.- titleOpacitydict, float,
ExprRef
Opacity of the axis title.
- titlePaddingdict, float,
ExprRef
The padding, in pixels, between title and axis.
- titleXdict, float,
ExprRef
X-coordinate of the axis title relative to the axis group.
- titleYdict, float,
ExprRef
Y-coordinate of the axis title relative to the axis group.
- translatedict, float,
ExprRef
Coordinate space translation offset for axis layout. By default, axes are translated by a 0.5 pixel offset for both the x and y coordinates in order to align stroked lines with the pixel grid. However, for vector graphics output these pixel-specific adjustments may be undesirable, in which case translate can be changed (for example, to zero).
Default value:
0.5
- valuesdict, Sequence[str], Sequence[bool], Sequence[float],
ExprRef
, Sequence[dict,DateTime
] Explicitly set the visible axis tick values.
- zindexfloat
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
to1
or more.Default value:
0
(behind the marks).
- ariabool, dict,
- __init__(aria=Undefined, bandPosition=Undefined, description=Undefined, domain=Undefined, domainCap=Undefined, domainColor=Undefined, domainDash=Undefined, domainDashOffset=Undefined, domainOpacity=Undefined, domainWidth=Undefined, format=Undefined, formatType=Undefined, grid=Undefined, gridCap=Undefined, gridColor=Undefined, gridDash=Undefined, gridDashOffset=Undefined, gridOpacity=Undefined, gridWidth=Undefined, labelAlign=Undefined, labelAngle=Undefined, labelBaseline=Undefined, labelBound=Undefined, labelColor=Undefined, labelExpr=Undefined, labelFlush=Undefined, labelFlushOffset=Undefined, labelFont=Undefined, labelFontSize=Undefined, labelFontStyle=Undefined, labelFontWeight=Undefined, labelLimit=Undefined, labelLineHeight=Undefined, labelOffset=Undefined, labelOpacity=Undefined, labelOverlap=Undefined, labelPadding=Undefined, labelSeparation=Undefined, labels=Undefined, maxExtent=Undefined, minExtent=Undefined, offset=Undefined, orient=Undefined, position=Undefined, style=Undefined, tickBand=Undefined, tickCap=Undefined, tickColor=Undefined, tickCount=Undefined, tickDash=Undefined, tickDashOffset=Undefined, tickExtra=Undefined, tickMinStep=Undefined, tickOffset=Undefined, tickOpacity=Undefined, tickRound=Undefined, tickSize=Undefined, tickWidth=Undefined, ticks=Undefined, title=Undefined, titleAlign=Undefined, titleAnchor=Undefined, titleAngle=Undefined, titleBaseline=Undefined, titleColor=Undefined, titleFont=Undefined, titleFontSize=Undefined, titleFontStyle=Undefined, titleFontWeight=Undefined, titleLimit=Undefined, titleLineHeight=Undefined, titleOpacity=Undefined, titlePadding=Undefined, titleX=Undefined, titleY=Undefined, translate=Undefined, values=Undefined, zindex=Undefined, **kwds)#
Methods
__init__
([aria, bandPosition, description, ...])copy
([deep, ignore])Return a copy of the object.
from_dict
(dct[, validate])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, indent, sort_keys, ...])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.