altair.LinearGradient#
- class altair.LinearGradient(gradient=Undefined, stops=Undefined, id=Undefined, x1=Undefined, x2=Undefined, y1=Undefined, y2=Undefined, **kwds)#
LinearGradient 模式包装器。
- 参数:
- gradientLiteral[‘linear’]
渐变类型。线性渐变使用
"linear"
。- stopsSequence[dict,
GradientStop
] 定义渐变颜色序列的渐变停止点数组。
- idstr
- x1float
线性渐变的起始 x 坐标,范围为归一化的 [0, 1] 坐标。
默认值:
0
- x2float
线性渐变的结束 x 坐标,范围为归一化的 [0, 1] 坐标。
默认值:
1
- y1float
线性渐变的起始 y 坐标,范围为归一化的 [0, 1] 坐标。
默认值:
0
- y2float
线性渐变的结束 y 坐标,范围为归一化的 [0, 1] 坐标。
默认值:
0
- __init__(gradient=Undefined, stops=Undefined, id=Undefined, x1=Undefined, x2=Undefined, y1=Undefined, y2=Undefined, **kwds)#
方法
__init__
([gradient, stops, id, x1, x2, y1, y2])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])在根模式的上下文中根据属性模式验证属性。