altair.FormatConfig#
- class altair.FormatConfig(normalizedNumberFormat=Undefined, normalizedNumberFormatType=Undefined, numberFormat=Undefined, numberFormatType=Undefined, timeFormat=Undefined, timeFormatType=Undefined, **kwds)#
FormatConfig schema wrapper.
- Parameters:
- normalizedNumberFormatstr
If normalizedNumberFormatType is not specified, D3 number format for axis labels, text marks, and tooltips of normalized stacked fields (fields with
stack: "normalize"). For example"s"for SI units. Use D3’s number format pattern.If
config.normalizedNumberFormatTypeis specified andconfig.customFormatTypesistrue, this value will be passed asformatalongsidedatum.valueto theconfig.numberFormatTypefunction. Default value:%- normalizedNumberFormatTypestr
Custom format type for
config.normalizedNumberFormat.Default value:
undefined– This is equilvalent to call D3-format, which is exposed as format in Vega-Expression. Note: You must also setcustomFormatTypestotrueto use this feature.- numberFormatstr
If numberFormatType is not specified, D3 number format for guide labels, text marks, and tooltips of non-normalized fields (fields without
stack: "normalize"). For example"s"for SI units. Use D3’s number format pattern.If
config.numberFormatTypeis specified andconfig.customFormatTypesistrue, this value will be passed asformatalongsidedatum.valueto theconfig.numberFormatTypefunction.- numberFormatTypestr
Custom format type for
config.numberFormat.Default value:
undefined– This is equilvalent to call D3-format, which is exposed as format in Vega-Expression. Note: You must also setcustomFormatTypestotrueto use this feature.- timeFormatstr
Default time format for raw time values (without time units) in text marks, legend labels and header labels.
Default value:
"%b %d, %Y"Note: Axes automatically determine the format for each label automatically so this config does not affect axes.- timeFormatTypestr
Custom format type for
config.timeFormat.Default value:
undefined– This is equilvalent to call D3-time-format, which is exposed as timeFormat in Vega-Expression. Note: You must also setcustomFormatTypestotrueand there must not be atimeUnitdefined to use this feature.
- __init__(normalizedNumberFormat=Undefined, normalizedNumberFormatType=Undefined, numberFormat=Undefined, numberFormatType=Undefined, timeFormat=Undefined, timeFormatType=Undefined, **kwds)#
Methods
__init__([normalizedNumberFormat, ...])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.