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.normalizedNumberFormatType
is specified andconfig.customFormatTypes
istrue
, this value will be passed asformat
alongsidedatum.value
to theconfig.numberFormatType
function. 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 setcustomFormatTypes
totrue
to 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.numberFormatType
is specified andconfig.customFormatTypes
istrue
, this value will be passed asformat
alongsidedatum.value
to theconfig.numberFormatType
function.- 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 setcustomFormatTypes
totrue
to 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 setcustomFormatTypes
totrue
and there must not be atimeUnit
defined 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.