altair.TitleParams#

class altair.TitleParams(text=Undefined, align=Undefined, anchor=Undefined, angle=Undefined, aria=Undefined, baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, limit=Undefined, lineHeight=Undefined, offset=Undefined, orient=Undefined, style=Undefined, subtitle=Undefined, subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds)#

TitleParams 模式包装器。

参数:
textstr, dict, Text, Sequence[str], ExprRef

标题文本。

alignAlign, Literal[‘left’, ‘center’, ‘right’]

标题文本的水平对齐方式。可以是 "left""center""right" 之一。

anchorTitleAnchor, Literal[None, ‘start’, ‘middle’, ‘end’]

放置标题的锚点位置。可以是 "start""middle""end" 之一。例如,当方向为顶部时,这些锚点位置对应于左对齐、居中对齐或右对齐的标题。

默认值:对于 单一图层化 视图为 "middle"。对于其他复合视图为 "start"

注意:目前anchor 仅可针对 单一图层化 视图进行自定义。对于其他复合视图,anchor 始终为 "start"

angledict, float, ExprRef

标题和副标题文本的角度(以度为单位)。

ariabool, dict, ExprRef

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

默认值: true"

baselineBaseline, 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

colorstr, dict, 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’], None

标题文本颜色。

dxdict, float, ExprRef

标题和副标题文本 x 坐标的增量偏移。

dydict, float, ExprRef

标题和副标题文本 y 坐标的增量偏移。

fontstr, dict, ExprRef

标题文本字体名称。

fontSizedict, float, ExprRef

标题文本的字体大小(以像素为单位)。

fontStylestr, dict, ExprRef, FontStyle

标题文本的字体样式。

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)。

framestr, dict, ExprRef, TitleFrame, Literal[‘bounds’, ‘group’]

锚点位置的参考框架,可以是 "bounds"(相对于完整边界框进行锚定)或 "group"(相对于组的宽度或高度进行锚定)之一。

limitdict, float, ExprRef

标题和副标题文本允许的最大长度(以像素为单位)。

lineHeightdict, float, ExprRef

多行标题文本或使用 "line-top""line-bottom" 基线的标题文本的行高(以像素为单位)。

offsetdict, float, ExprRef

标题组相对于图表边缘位置的正交偏移量(以像素为单位)。

orientdict, ExprRef, TitleOrient, Literal[‘none’, ‘left’, ‘right’, ‘top’, ‘bottom’]

默认标题方向("top", "bottom", "left", 或 "right"

stylestr, Sequence[str]

应用于标题文本标记的标记样式属性

默认值: "group-title"

subtitlestr, Text, Sequence[str]

副标题文本。

subtitleColorstr, dict, 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’], None

副标题文本颜色。

subtitleFontstr, dict, ExprRef

副标题文本字体名称。

subtitleFontSizedict, float, ExprRef

副标题文本的字体大小(以像素为单位)。

subtitleFontStylestr, dict, ExprRef, FontStyle

副标题文本的字体样式。

subtitleFontWeightdict, 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)。

subtitleLineHeightdict, float, ExprRef

多行副标题文本的行高(以像素为单位)。

subtitlePaddingdict, float, ExprRef

标题和副标题文本之间的填充(以像素为单位)。

zindexfloat

指示标题组相对于其他轴、标记和图例组分层顺序的整数 z-index。

默认值: 0

__init__(text=Undefined, align=Undefined, anchor=Undefined, angle=Undefined, aria=Undefined, baseline=Undefined, color=Undefined, dx=Undefined, dy=Undefined, font=Undefined, fontSize=Undefined, fontStyle=Undefined, fontWeight=Undefined, frame=Undefined, limit=Undefined, lineHeight=Undefined, offset=Undefined, orient=Undefined, style=Undefined, subtitle=Undefined, subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds)#

方法

__init__([text, align, anchor, angle, aria, ...])

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])

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