altair.TitleConfig#

class altair.TitleConfig(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, subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds)#

TitleConfig schema 包装器。

参数:
alignAlign, Literal[‘left’, ‘center’, ‘right’]

标题文本的水平对齐方式。可选择 "left"(左对齐)、"center"(居中)或 "right"(右对齐)。

anchordict, ExprRef, TitleAnchor, Literal[None, ‘start’, ‘middle’, ‘end’]

放置标题和副标题文本的锚点位置。可选择 "start"(开始)、"middle"(中间)或 "end"(结束)。例如,当方向为顶部时,这些锚点位置对应于左对齐、居中或右对齐的标题。

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"(右))

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

标题和副标题文本之间的内边距(像素)。

zindexdict, float, ExprRef

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

默认值: 0

__init__(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, subtitleColor=Undefined, subtitleFont=Undefined, subtitleFontSize=Undefined, subtitleFontStyle=Undefined, subtitleFontWeight=Undefined, subtitleLineHeight=Undefined, subtitlePadding=Undefined, zindex=Undefined, **kwds)#

方法

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

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 验证属性。