altair.BarConfig#

class altair.BarConfig(align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, binSpacing=Undefined, blend=Undefined, color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, padAngle=Undefined, radius=Undefined, radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, **kwds)#

BarConfig schema 包装器。

参数:
aligndict, Align, ExprRef, Literal[‘left’, ‘center’, ‘right’]

文本或范围标记(area, bar, image, rect, rule)的水平对齐方式。取值范围为 "left", "right", "center"

注意:范围标记支持 Expression reference。

angledict, float, ExprRef

文本的旋转角度,单位为度。

ariabool, dict, ExprRef

一个布尔标志,指示是否应包含ARIA attributes(仅限 SVG 输出)。如果为 false,则会在输出 SVG 元素上设置“aria-hidden”属性,从而从 ARIA 可访问性树中移除标记项。

ariaRolestr, dict, ExprRef

ARIA 可访问性设置标记项的用户界面元素类型(仅限 SVG 输出)。如果指定,此属性确定“role”属性。警告:此属性是实验性的,将来可能会更改。

ariaRoleDescriptionstr, dict, ExprRef

标记项角色的人类可读、作者本地化的描述,用于ARIA 可访问性(仅限 SVG 输出)。如果指定,此属性确定“aria-label”属性。警告:此属性是实验性的,将来可能会更改。

aspectbool, dict, ExprRef

是否保持图像标记的纵横比。

baselinedict, ExprRef, Baseline, TextBaseline, Literal[‘alphabetic’, ‘line-bottom’, ‘line-top’, ‘top’, ‘middle’, ‘bottom’]

对于文本标记,文本的垂直基线。取值范围为 "alphabetic"(默认)、"top""middle""bottom""line-top""line-bottom",或者提供其中一个有效值的表达式引用。"line-top""line-bottom" 值与 "top""bottom" 类似,但是相对于 lineHeight 计算,而不是仅相对于 fontSize

对于范围标记,标记的垂直对齐方式。取值范围为 "top""middle""bottom"

注意:范围标记支持 Expression reference。

binSpacingfloat

分箱字段的条形之间的偏移量。理想值要么是 0(统计学家偏爱),要么是 1(Vega-Lite 默认值,D3 示例样式)。

默认值:1

blenddict, Blend, ExprRef, Literal[None, ‘multiply’, ‘screen’, ‘overlay’, ‘darken’, ‘lighten’, ‘color-dodge’, ‘color-burn’, ‘hard-light’, ‘soft-light’, ‘difference’, ‘exclusion’, ‘hue’, ‘saturation’, ‘color’, ‘luminosity’]

在当前背景上绘制项目时的颜色混合模式。可以使用任何有效的CSS mix-blend-mode 值。

__默认值:__ "source-over"

colorstr, dict, Color, ExprRef, Gradient, HexColor, ColorName, LinearGradient, RadialGradient, 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’]

默认颜色。

默认值: "#4682b4"

注意

  • 样式配置中不能使用此属性。

  • fillstroke 属性的优先级高于 color,并且会覆盖 color

continuousBandSizefloat

连续刻度上条形的默认尺寸。

默认值:5

cornerRadiusdict, float, ExprRef

圆角矩形或弧形角点的半径(像素)。

默认值:0

cornerRadiusBottomLeftdict, float, ExprRef

圆角矩形左下角的半径(像素)。

默认值:0

cornerRadiusBottomRightdict, float, ExprRef

圆角矩形右下角的半径(像素)。

默认值:0

cornerRadiusEnddict, float, ExprRef
  • 对于垂直条,左上角和右上角半径。

  • 对于水平条,右上角和右下角半径。

cornerRadiusTopLeftdict, float, ExprRef

圆角矩形右上角的半径(像素)。

默认值:0

cornerRadiusTopRightdict, float, ExprRef

圆角矩形左上角的半径(像素)。

默认值:0

cursordict, Cursor, ExprRef, Literal[‘auto’, ‘default’, ‘none’, ‘context-menu’, ‘help’, ‘pointer’, ‘progress’, ‘wait’, ‘cell’, ‘crosshair’, ‘text’, ‘vertical-text’, ‘alias’, ‘copy’, ‘move’, ‘no-drop’, ‘not-allowed’, ‘e-resize’, ‘n-resize’, ‘ne-resize’, ‘nw-resize’, ‘s-resize’, ‘se-resize’, ‘sw-resize’, ‘w-resize’, ‘ew-resize’, ‘ns-resize’, ‘nesw-resize’, ‘nwse-resize’, ‘col-resize’, ‘row-resize’, ‘all-scroll’, ‘zoom-in’, ‘zoom-out’, ‘grab’, ‘grabbing’]

鼠标悬停在标记上时使用的鼠标光标。可以使用任何有效的CSS cursor type值。

descriptionstr, dict, ExprRef

标记项的人类可读文本描述,用于ARIA 可访问性(仅限 SVG 输出)。如果指定,此属性确定“aria-label”属性

dirdict, ExprRef, TextDirection, Literal[‘ltr’, ‘rtl’]

文本方向。取值范围为 "ltr"(从左到右)或 "rtl"(从右到左)。此属性决定了响应 limit 参数时文本在哪一侧被截断。

默认值:"ltr"

discreteBandSizedict, float, RelativeBandSize

离散维度条形的默认尺寸。如果未指定,默认尺寸为 step-2,提供条形之间 2 像素的偏移。

dxdict, float, ExprRef

文本标签与其锚点之间的水平偏移,单位为像素。偏移在经过 angle 属性旋转后应用。

dydict, float, ExprRef

文本标签与其锚点之间的垂直偏移,单位为像素。偏移在经过 angle 属性旋转后应用。

ellipsisstr, dict, ExprRef

响应 limit 参数截断文本时使用的省略号字符串。

默认值:"…"

endAngledict, float, ExprRef

弧形标记的结束角度,单位为弧度。值为 0 表示向上(北),值增加则顺时针方向。

fillstr, dict, Color, ExprRef, Gradient, HexColor, ColorName, LinearGradient, RadialGradient, 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’], None

默认填充颜色。此属性的优先级高于 config.color。设为 null 可移除填充。

默认值:(无)

fillOpacitydict, float, ExprRef

填充不透明度(取值范围 [0,1])。

默认值:1

filledbool

标记的颜色是否应用作填充颜色而不是描边颜色。

默认值:对于所有 pointlinerule 标记以及 经纬线数据源的 geoshape 标记为 false;否则为 true

注意:样式配置中不能使用此属性。

fontstr, dict, ExprRef

文本使用的字体(例如,"Helvetica Neue")。

fontSizedict, float, ExprRef

字体大小,单位为像素。

默认值:11

fontStylestr, dict, ExprRef, FontStyle

字体样式(例如,"italic")。

fontWeightdict, ExprRef, FontWeight, Literal[‘normal’, ‘bold’, ‘lighter’, ‘bolder’, 100, 200, 300, 400, 500, 600, 700, 800, 900]

字体粗细。可以是一个字符串(例如 "bold", "normal")或一个数字(100, 200, 300, …, 900,其中 "normal" = 400"bold" = 700)。

heightdict, float, ExprRef

标记的高度。

hrefstr, dict, URI, ExprRef

鼠标单击时加载的 URL。如果定义,则该标记充当超链接。

innerRadiusdict, float, ExprRef

弧形标记的内半径,单位为像素。innerRadiusradius2 的别名。

默认值:0

interpolatedict, ExprRef, Interpolate, Literal[‘basis’, ‘basis-open’, ‘basis-closed’, ‘bundle’, ‘cardinal’, ‘cardinal-open’, ‘cardinal-closed’, ‘catmull-rom’, ‘linear’, ‘linear-closed’, ‘monotone’, ‘natural’, ‘step’, ‘step-before’, ‘step-after’]

用于线和面积标记的线条插值方法。以下之一:

  • "linear":分段线性段,如同折线。

  • "linear-closed":闭合线性段以形成多边形。

  • "step":在水平和垂直段之间交替,如同阶跃函数。

  • "step-before":在垂直和水平段之间交替,如同阶跃函数。

  • "step-after":在水平和垂直段之间交替,如同阶跃函数。

  • "basis":B 样条曲线,末端控制点重复。

  • "basis-open":开放 B 样条曲线;可能不与起点或终点相交。

  • "basis-closed":闭合 B 样条曲线,如同循环。

  • "cardinal":Cardinal 样条曲线,末端控制点重复。

  • "cardinal-open":开放 Cardinal 样条曲线;可能不与起点或终点相交,但会与其他控制点相交。

  • "cardinal-closed":闭合 Cardinal 样条曲线,如同循环。

  • "bundle":等同于 basis,除了使用张力参数来拉直样条曲线。

  • "monotone":在 y 方向保持单调性的三次插值。

invalidMarkInvalidDataMode, Literal[‘filter’, ‘break-paths-filter-domains’, ‘break-paths-show-domains’, ‘break-paths-show-path-domains’, ‘show’], None

无效数据模式,它定义了标记和相应刻度如何表示无效值(在连续刻度中对于无效值没有定义输出的 nullNaN)。

  • "filter"可视化效果的标记刻度排除所有无效值。对于路径标记(线、面积、轨迹),此选项将创建连接有效点的路径,如同具有无效值的数据行不存在。

  • "break-paths-filter-domains" — 在无效值处断开路径标记(线、面积、轨迹)。对于非路径标记,这等同于 "filter"。所有刻度域将排除这些过滤后的数据点。

  • "break-paths-show-domains" — 在无效值处断开路径(线、面积、轨迹)。对于非路径标记隐藏无效值。所有刻度域将包含这些过滤后的数据点(对于路径和非路径标记)。

  • "show"null — 在标记和刻度域中显示所有数据点。每个刻度将使用 config.scale.invalid 中定义的无效值输出,或者,如果未指定,则默认情况下无效值将产生与零(如果刻度包含零)或最小值(如果刻度不包含零)相同的视觉值。

  • "break-paths-show-path-domains"(默认)— 这等同于基于路径的标记(线/面积/轨迹)的 "break-paths-show-domains" 和非路径标记的 "filter"

注意:如果任何通道的刻度在 config.scale.invalid 中定义了无效值的输出,则该刻度的所有值都将被视为“有效”,因为它们可以为刻度生成合理的输出。因此,此类通道的字段不会被过滤,也不会导致路径中断。

limitdict, float, ExprRef

文本标记的最大长度,单位为像素。如果渲染尺寸超过限制,文本值将自动被截断。

默认值:0 – 表示没有限制

lineBreakstr, dict, ExprRef

用于将文本字符串分解为多行的分隔符,例如换行符。如果文本是数组值,则忽略此属性。

lineHeightdict, float, ExprRef

多行文本标记的行高(后续行之间的间距),单位为像素。

minBandSizedict, float, ExprRef

条形和矩形标记的最小条带尺寸。默认值:0.25

opacitydict, float, ExprRef

整体不透明度(取值范围 [0,1])。

默认值:对于非聚合图表且标记为 point, tick, circlesquare 或分层 bar 图表,为 0.7;否则为 1

orderbool, None

对于线和轨迹标记,可以将此 order 属性设置为 nullfalse,使线使用数据源中的原始顺序。

orientOrientation, Literal[‘horizontal’, ‘vertical’]

非堆叠条形图、刻度图、面积图和线图的方向。取值范围为水平(默认)或垂直。

  • 对于 bar、rule 和 tick,这决定了条形和刻度的尺寸应应用于 x 还是 y 维度。

  • 对于 area,此属性确定 Vega 输出的 orient 属性。

  • 对于线和轨迹标记,如果未指定 config.sortLineBy,则此属性确定线中点的排序顺序。对于堆叠图表,这始终由堆叠的方向确定;因此,明确指定的值将被忽略。

outerRadiusdict, float, ExprRef

弧形标记的外半径,单位为像素。outerRadiusradius 的别名。

默认值:0

padAngledict, float, ExprRef

应用于弧形两侧的角度填充,单位为弧度。

radiusdict, float, ExprRef

对于弧形标记,主(外)半径,单位为像素。

对于文本标记,文本相对于由 xy 属性确定的原点的极坐标径向偏移,单位为像素。

默认值:min(plot_width, plot_height)/2

radius2dict, float, ExprRef

弧形标记的次(内)半径,单位为像素。

默认值:0

shapestr, dict, ExprRef, SymbolShape

点标记的形状。支持的值包括:

  • 绘图形状:"circle""square""cross""diamond""triangle-up""triangle-down""triangle-right""triangle-left"

  • 线条符号 "stroke"

  • 中心方向形状 "arrow""wedge""triangle"

  • 自定义 SVG path 字符串(为了正确的大小调整,自定义形状路径应定义在 x 和 y 维度坐标范围均为 -1 到 1 的方形边界框内)。

默认值:"circle"

sizedict, float, ExprRef

标记的默认尺寸。

  • 对于 point/circle/square,这表示标记的像素面积。请注意,此值设置符号的面积;边长将随该值的平方根增加。

  • 对于 bar,这表示条形的带尺寸,单位为像素。

  • 对于 text,这表示字体大小,单位为像素。

默认值

  • 点、圆、方形标记为 30;width/height 的 step

  • 离散维度的条形标记为 2

  • 连续维度的条形标记为 5

  • 文本标记为 11

smoothbool, dict, ExprRef

一个布尔标志(默认为 true),指示图像在调整大小时是否应该平滑。如果为 false,则应直接缩放单个像素,而不是使用平滑进行插值。对于 SVG 渲染,由于缺乏标准化,此选项在某些浏览器中可能不起作用。

startAngledict, float, ExprRef

弧形标记的起始角度,单位为弧度。值为 0 表示向上(北),值增加则顺时针方向。

strokestr, dict, Color, ExprRef, Gradient, HexColor, ColorName, LinearGradient, RadialGradient, 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’], None

默认描边颜色。此属性优先级高于 config.color。设为 null 可移除描边。

默认值:(无)

strokeCapdict, ExprRef, StrokeCap, Literal[‘butt’, ‘round’, ‘square’]

线条末端的描边端点样式。可为 "butt""round""square" 之一。

默认值: "butt"

strokeDashdict, Sequence[float], ExprRef

一个交替的描边、空格长度数组,用于创建虚线或点线。

strokeDashOffsetdict, float, ExprRef

开始绘制描边虚线数组时的偏移量(以像素为单位)。

strokeJoindict, ExprRef, StrokeJoin, Literal[‘miter’, ‘round’, ‘bevel’]

描边线条连接方法。可为 "miter""round""bevel" 之一。

默认值: "miter"

strokeMiterLimitdict, float, ExprRef

在此斜接限制下,线条连接处将被倒角。

strokeOffsetdict, float, ExprRef

绘制组描边和填充时的像素偏移量。如果未指定,默认行为是动态偏移带描边的组,使 1 像素描边宽度与像素网格对齐。

strokeOpacitydict, float, ExprRef

描边不透明度(取值范围 [0,1])。

默认值:1

strokeWidthdict, float, ExprRef

描边宽度,以像素为单位。

tensiondict, float, ExprRef

根据插值类型,设置张力参数(适用于线和面积标记)。

textstr, dict, Text, Sequence[str], ExprRef

如果未指定 text 通道,则显示占位符文本

thetadict, float, ExprRef
  • 对于弧形标记,如果未指定 theta2,则表示弧长(以弧度为单位),否则表示起始弧角。(0 表示向上或“北方”,增加的值顺时针方向进行。)

  • 对于文本标记,表示极坐标角度(以弧度为单位)。

theta2dict, float, ExprRef

弧形标记的结束角度(以弧度为单位)。0 表示向上或“北方”,增加的值顺时针方向进行。

timeUnitBandPositionfloat

时间单位的默认相对频带位置。如果设为 0,标记将位于时间单位频带步长的起始位置。如果设为 0.5,标记将位于时间单位频带步长的中间位置。

timeUnitBandSizefloat

时间单位的默认相对频带大小。如果设为 1,标记的带宽将等于时间单位频带步长。如果设为 0.5,标记的带宽将是时间单位频带步长的一半。

tooltipstr, bool, dict, float, ExprRef, TooltipContent, None

鼠标悬停时显示的工具提示文本字符串,或一个定义工具提示应从哪些字段派生的对象。

  • 如果 tooltiptrue{"content": "encoding"},则将使用 encoding 中的所有字段。

  • 如果 tooltip{"content": "data"},则将使用高亮数据点中出现的所有字段。

  • 如果设为 nullfalse,则不使用工具提示。

有关 Vega-Lite 中工具提示的详细讨论,请参阅 工具提示 文档。

默认值: null

urlstr, dict, URI, ExprRef

图像标记的图片文件 URL。

widthdict, float, ExprRef

标记的宽度。

xdict, float, ExprRef, Literal[‘width’]

标记的 X 坐标,或未指定 x2width 的水平 "bar""area" 的宽度。

此通道的 value 可以是数字或字符串 "width",表示图的宽度。

x2dict, float, ExprRef, Literal[‘width’]

范围型 "area""bar""rect""rule" 的 X2 坐标。

此通道的 value 可以是数字或字符串 "width",表示图的宽度。

ydict, float, ExprRef, Literal[‘height’]

标记的 Y 坐标,或未指定 y2height 的垂直 "bar""area" 的高度。

此通道的 value 可以是数字或字符串 "height",表示图的高度。

y2dict, float, ExprRef, Literal[‘height’]

范围型 "area""bar""rect""rule" 的 Y2 坐标。

此通道的 value 可以是数字或字符串 "height",表示图的高度。

__init__(align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, binSpacing=Undefined, blend=Undefined, color=Undefined, continuousBandSize=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, cornerRadiusEnd=Undefined, cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=Undefined, discreteBandSize=Undefined, dx=Undefined, dy=Undefined, ellipsis=Undefined, endAngle=Undefined, fill=Undefined, fillOpacity=Undefined, filled=Undefined, font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, height=Undefined, href=Undefined, innerRadius=Undefined, interpolate=Undefined, invalid=Undefined, limit=Undefined, lineBreak=Undefined, lineHeight=Undefined, minBandSize=Undefined, opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, padAngle=Undefined, radius=Undefined, radius2=Undefined, shape=Undefined, size=Undefined, smooth=Undefined, startAngle=Undefined, stroke=Undefined, strokeCap=Undefined, strokeDash=Undefined, strokeDashOffset=Undefined, strokeJoin=Undefined, strokeMiterLimit=Undefined, strokeOffset=Undefined, strokeOpacity=Undefined, strokeWidth=Undefined, tension=Undefined, text=Undefined, theta=Undefined, theta2=Undefined, timeUnitBandPosition=Undefined, timeUnitBandSize=Undefined, tooltip=Undefined, url=Undefined, width=Undefined, x=Undefined, x2=Undefined, y=Undefined, y2=Undefined, **kwds)#

方法

__init__([align, angle, aria, ariaRole, ...])

copy([deep, ignore])

返回对象的副本。

from_dict(dct[, validate])

从字典表示构建类。

from_json(json_string[, validate])

从有效的 JSON 字符串实例化对象。

resolve_references([schema])

在此对象模式或根模式的上下文中解析引用。

to_dict([validate, ignore, context])

返回对象的字典表示。

to_json([validate, indent, sort_keys, ...])

将此对象的 JSON 表示输出为字符串。

validate(instance[, schema])

在根模式的上下文中,根据类模式验证实例。

validate_property(name, value[, schema])

在根模式的上下文中,根据属性模式验证属性。