altair.StackTransform#
- class altair.StackTransform(groupby=Undefined, stack=Undefined, offset=Undefined, sort=Undefined, **kwds)#
StackTransform schema wrapper.
- Parameters:
- groupbySequence[str,
FieldName
] The data fields to group by.
- stackstr,
FieldName
The field which is stacked.
- offsetLiteral[‘zero’, ‘center’, ‘normalize’]
Mode for stacking marks. One of
"zero"
(default),"center"
, or"normalize"
. The"zero"
offset will stack starting at0
. The"center"
offset will center the stacks. The"normalize"
offset will compute percentage values for each stack point, with output values in the range[0,1]
.Default value:
"zero"
- sortSequence[dict,
SortField
] Field that determines the order of leaves in the stacked charts.
- asstr,
FieldName
, Sequence[str,FieldName
] Output field names. This can be either a string or an array of strings with two elements denoting the name for the fields for stack start and stack end respectively. If a single string(e.g.,
"val"
) is provided, the end field will be"val_end"
.
- groupbySequence[str,
- __init__(groupby=Undefined, stack=Undefined, offset=Undefined, sort=Undefined, **kwds)#
Methods
__init__
([groupby, stack, offset, sort])copy
([deep, ignore])Return a copy of the object.
from_dict
(dct[, validate])Construct class from a dictionary representation.
from_json
(json_string[, validate])Instantiate the object from a valid JSON string.
resolve_references
([schema])Resolve references in the context of this object's schema or root schema.
to_dict
([validate, ignore, context])Return a dictionary representation of the object.
to_json
([validate, indent, sort_keys, ...])Emit the JSON representation for this object as a string.
validate
(instance[, schema])Validate the instance against the class schema in the context of the rootschema.
validate_property
(name, value[, schema])Validate a property against property schema in the context of the rootschema.