altair.LineConfig#
- class altair.LineConfig(align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=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, opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=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)#
LineConfig schema 封装器。
- 参数:
- aligndict,
Align,ExprRef, Literal[‘left’, ‘center’, ‘right’] 文本或范围标记(area、bar、image、rect、rule)的水平对齐方式。可选值为
"left","right","center"。注意:范围标记不支持表达式引用。
- angledict, float,
ExprRef 文本的旋转角度,以度为单位。
- ariabool, dict,
ExprRef 一个布尔标志,指示是否应包含ARIA 属性(仅限 SVG 输出)。如果为
false,则会在输出的 SVG 元素上设置“aria-hidden”属性,将标记项从 ARIA 可访问性树中移除。- ariaRolestr, dict,
ExprRef 为标记项设置用户界面元素类型,用于ARIA 可访问性(仅限 SVG 输出)。如果指定,此属性将确定“role”属性。警告:此属性是实验性的,将来可能会更改。
- ariaRoleDescriptionstr, dict,
ExprRef 标记项角色的可读的、作者本地化的描述,用于ARIA 可访问性(仅限 SVG 输出)。如果指定,此属性将确定“aria-roledescription”属性。警告:此属性是实验性的,将来可能会更改。
- 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"。注意:范围标记不支持表达式引用。
- 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"注意
此属性不能用于style config中。
fill和stroke属性的优先级高于color,并且会覆盖color。
- cornerRadiusdict, float,
ExprRef 圆角矩形或弧形角的像素半径。
默认值:
0- cornerRadiusBottomLeftdict, float,
ExprRef 圆角矩形左下角的像素半径。
默认值:
0- cornerRadiusBottomRightdict, float,
ExprRef 圆角矩形右下角的像素半径。
默认值:
0- 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"- 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以移除填充。默认值: (None)
- fillOpacitydict, float,
ExprRef 填充不透明度(值介于 [0,1] 之间)。
默认值:
1- filledbool
标记的颜色是作为填充颜色还是描边颜色使用。
默认值: 对于所有
point,line, 和rule标记以及 graticule 数据源的geoshape标记为false;否则为true。注意: 此属性不能用于style config中。
- 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 弧形标记的内半径,以像素为单位。
innerRadius是radius2的别名。默认值:
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 方向上保持单调性的三次插值。
- invalid
MarkInvalidDataMode, Literal[‘filter’, ‘break-paths-filter-domains’, ‘break-paths-show-domains’, ‘break-paths-show-path-domains’, ‘show’], None 无效数据模式,定义标记和相应的比例如何表示无效值(连续比例中没有定义无效值输出时的
null和NaN)。"filter"— 从可视化图的标记和比例中排除所有无效值。对于路径标记(line, area, trail),此选项将创建连接有效点的路径,就像包含无效值的数据行不存在一样。"break-paths-filter-domains"— 在无效值处断开路径标记(line, area, trail)。对于非路径标记,这等同于"filter"。所有比例域将排除这些过滤后的数据点。"break-paths-show-domains"— 在无效值处断开路径(line, area, trail)。对于非路径标记,隐藏无效值。所有比例域将包含这些过滤后的数据点(对于路径和非路径标记)。"show"或null— 在标记和比例域中显示所有数据点。每个比例将使用config.scale.invalid中定义的无效值输出,或者,如果未指定,默认情况下无效值将产生与零(如果比例包含零)或最小值(如果比例不包含零)相同的视觉值。"break-paths-show-path-domains"(默认) — 对于基于路径的标记(line/area/trail),这等同于"break-paths-show-domains";对于非路径标记,这等同于"filter"。
注意: 如果任何通道的比例在
config.scale.invalid中定义了无效值的输出,则所有这些比例的值都将被视为“有效”,因为它们可以产生合理的比例输出。因此,这些通道的字段将不会被过滤,也不会导致路径断开。- limitdict, float,
ExprRef 文本标记的最大长度,以像素为单位。如果渲染尺寸超过此限制,文本值将自动截断。
默认值:
0– 表示无限制- lineBreakstr, dict,
ExprRef 一个分隔符,如换行符,用于将文本字符串拆分为多行。如果文本是数组值,此属性将被忽略。
- lineHeightdict, float,
ExprRef 多行文本标记的行高,以像素为单位(后续行之间的间距)。
- opacitydict, float,
ExprRef 总不透明度(值介于 [0,1] 之间)。
默认值: 对于使用
point,tick,circle, 或square标记的非聚合图以及分层bar图表,为0.7;否则为1。- orderbool, None
对于 line 和 trail 标记,可以将此
order属性设置为null或false,使线条使用数据源中的原始顺序。- orient
Orientation, Literal[‘horizontal’, ‘vertical’] 非堆积条形图、刻度图、面积图和线图的方向。值为 horizontal (默认) 或 vertical。
对于 bar、rule 和 tick,这决定了 bar 和 tick 的大小应应用于 x 维度还是 y 维度。
对于 area,此属性决定了 Vega 输出的 orient 属性。
对于 line 和 trail 标记,如果未指定
config.sortLineBy,此属性决定了线中点的排序顺序。对于堆积图表,这总是由堆积的方向决定;因此,明确指定的值将被忽略。
- outerRadiusdict, float,
ExprRef 弧形标记的外半径,以像素为单位。
outerRadius是radius的别名。默认值:
0- padAngledict, float,
ExprRef 应用于弧形两侧的角填充,以弧度为单位。
- pointbool, dict, Literal[‘transparent’],
OverlayMarkDef 一个标志,用于在线条或面积标记顶部叠加点,或一个定义叠加点属性的对象。
如果此属性为
"transparent",则会使用透明点(用于增强工具提示和选择)。如果此属性是空对象 (
{}) 或true,则会使用具有默认属性的填充点。如果此属性为
false,则不会自动向线条或面积标记添加点。
默认值:
false。- radiusdict, float,
ExprRef 对于 arc 标记,主(外)半径,以像素为单位。
对于 text 标记,文本相对于
x和y属性确定的原点的极坐标径向偏移,以像素为单位。默认值:
min(plot_width, plot_height)/2- radius2dict, float,
ExprRef 弧形标记的次(内)半径,以像素为单位。
默认值:
0- 形状 (shape)str, dict,
ExprRef,SymbolShape 点标记的形状。支持的值包括:
绘图形状:
"circle"(圆),"square"(方形),"cross"(十字),"diamond"(菱形),"triangle-up"(上三角),"triangle-down"(下三角),"triangle-right"(右三角), 或"triangle-left"(左三角)。线条符号
"stroke"(描边)居中的方向性形状
"arrow"(箭头),"wedge"(楔形), 或"triangle"(三角)自定义 SVG 路径字符串 (为了正确的大小调整,自定义形状路径应定义在一个方形边界框内,其 x 和 y 维度坐标范围从 -1 到 1)。
默认值:
"circle"- 大小 (size)dict, float,
ExprRef 标记的默认大小。
对于
point(点)/circle(圆)/square(方形),这表示标记的像素面积。请注意,此值设置的是符号的面积;边长将随此值的平方根增加。对于
bar(条形),这表示条形的带状大小,单位为像素。对于
text(文本),这表示字体大小,单位为像素。
默认值:
对于点、圆、方形标记为
30;宽度/高度的step。对于离散维度的条形标记为
2;对于连续维度的条形标记为
5;对于文本标记为
11。
- 平滑 (smooth)bool, dict,
ExprRef 一个布尔标志(默认为 true),指示图像在调整大小时是否应平滑。如果为 false,则应直接缩放单个像素,而不是通过平滑进行插值。对于 SVG 渲染,此选项在某些浏览器中可能因缺乏标准化而无法工作。
- 起始角度 (startAngle)dict, float,
ExprRef 弧形标记的起始角度,单位为弧度。值为
0表示向上(北),值增加表示顺时针方向。- 描边颜色 (stroke)str, 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可移除描边。默认值: (None)
- 描边末端样式 (strokeCap)dict,
ExprRef,StrokeCap, Literal['butt', 'round', 'square'] 线段末端的描边样式。可选值为
"butt"(平直),"round"(圆形), 或"square"(方形)。默认值:
"butt"- 描边虚线模式 (strokeDash)dict, Sequence[float],
ExprRef 用于创建虚线或点划线的描边和空白长度交替数组。
- 描边虚线偏移 (strokeDashOffset)dict, float,
ExprRef 绘制描边虚线数组时的起始偏移量(单位为像素)。
- 描边连接样式 (strokeJoin)dict,
ExprRef,StrokeJoin, Literal['miter', 'round', 'bevel'] 描边线段连接方法。可选值为
"miter"(斜接),"round"(圆角) 或"bevel"(斜角)。默认值:
"miter"- 描边斜接限制 (strokeMiterLimit)dict, float,
ExprRef 斜接连接线段的斜接限制,超过此限制则变为斜角。
- 描边偏移 (strokeOffset)dict, float,
ExprRef 绘制分组描边和填充时的像素偏移量。如果未指定,默认行为是动态偏移描边分组,以便 1 像素描边宽度与像素网格对齐。
- 描边不透明度 (strokeOpacity)dict, float,
ExprRef 描边不透明度(值介于 [0,1] 之间)。
默认值:
1- 描边宽度 (strokeWidth)dict, float,
ExprRef 描边宽度,单位为像素。
- 张力 (tension)dict, float,
ExprRef 根据插值类型,设置张力参数(用于线和面积标记)。
- 文本 (text)str, dict,
Text, Sequence[str],ExprRef 如果未指定
text通道,则使用占位符文本。- 角度 (theta)dict, float,
ExprRef 对于弧形标记,如果未指定 theta2,则表示弧长(单位为弧度),否则表示起始弧角。(值为 0 表示向上或“北”,值增加表示顺时针方向。)
对于文本标记,表示极坐标角度,单位为弧度。
- 结束角度 (theta2)dict, float,
ExprRef 弧形标记的结束角度,单位为弧度。值为 0 表示向上或“北”,值增加表示顺时针方向。
- 时间单位带状位置 (timeUnitBandPosition)float
时间单位的默认相对带状位置。如果设置为
0,标记将定位在时间单位带状步长的起始处。如果设置为0.5,标记将定位在时间单位带状步长的中间。- 时间单位带状大小 (timeUnitBandSize)float
时间单位的默认相对带状大小。如果设置为
1,标记的带宽将等于时间单位带状步长。如果设置为0.5,标记的带宽将是时间单位带状步长的一半。- 工具提示 (tooltip)str, bool, dict, float,
ExprRef,TooltipContent, None 鼠标悬停时显示的工具提示文本字符串,或一个定义应从哪些字段派生工具提示的对象。
如果
tooltip为true或{"content": "encoding"},则将使用encoding中的所有字段。如果
tooltip为{"content": "data"},则将使用突出显示数据点中显示的所有字段。如果设为
null或false,则不使用工具提示。
有关 Vega-Lite 中工具提示的详细讨论,请参阅工具提示文档。
默认值:
null- URL (url)str, dict,
URI,ExprRef 图像标记的图像文件 URL。
- 宽度 (width)dict, float,
ExprRef 标记的宽度。
- x (x)dict, float,
ExprRef, Literal['width'] 标记的 X 坐标,或未指定
x2或width的水平"bar"(条形) 和"area"(面积) 的宽度。此通道的
value可以是数字或字符串"width",表示图表的宽度。- x2 (x2)dict, float,
ExprRef, Literal['width'] 范围标记
"area"(面积),"bar"(条形),"rect"(矩形), 和"rule"(标尺) 的 X2 坐标。此通道的
value可以是数字或字符串"width",表示图表的宽度。- y (y)dict, float,
ExprRef, Literal['height'] 标记的 Y 坐标,或未指定
y2或height的垂直"bar"(条形) 和"area"(面积) 的高度。此通道的
value可以是数字或字符串"height",表示图表的高度。- y2 (y2)dict, float,
ExprRef, Literal['height'] 范围标记
"area"(面积),"bar"(条形),"rect"(矩形), 和"rule"(标尺) 的 Y2 坐标。此通道的
value可以是数字或字符串"height",表示图表的高度。
- aligndict,
- __init__(align=Undefined, angle=Undefined, aria=Undefined, ariaRole=Undefined, ariaRoleDescription=Undefined, aspect=Undefined, baseline=Undefined, blend=Undefined, color=Undefined, cornerRadius=Undefined, cornerRadiusBottomLeft=Undefined, cornerRadiusBottomRight=Undefined, cornerRadiusTopLeft=Undefined, cornerRadiusTopRight=Undefined, cursor=Undefined, description=Undefined, dir=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, opacity=Undefined, order=Undefined, orient=Undefined, outerRadius=Undefined, padAngle=Undefined, point=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])在此对象的 schema 或根 schema 的上下文中解析引用。
to_dict([validate, ignore, context])返回对象的字典表示。
to_json([validate, indent, sort_keys, ...])将此对象的 JSON 表示作为字符串发出。
validate(instance[, schema])在根 schema 的上下文中根据类 schema 验证实例。
validate_property(name, value[, schema])在根 schema 的上下文中根据属性 schema 验证属性。