Skip to content

Constants Module

datachart.constants

Module containing the constants.

The constants module procides a set of predefined constants used in the package. These include figure size, format, style, and other figure manipulation values.

CLASS DESCRIPTION
FIG_SIZE

The predefined figure sizes.

FIG_FORMAT

The supported figure formats.

FONT_STYLE

The supported font styles.

FONT_WEIGHT

The supported font weights.

LINE_MARKER

The supported line markers.

LINE_STYLE

The supported line styles.

LINE_DRAW_STYLE

The supported line draw styles.

HATCH_STYLE

The supported hatch styles.

LEGEND_ALIGN

The supported legend alignments.

HISTOGRAM_TYPE

The supported histogram types.

COLORS

The predefined colors.

NORMALIZE

The supported normalization options.

ORIENTATION

The supported orientations.

VALFMT

The predefined value formats.

THEME

The predefined themes.

SHOW_GRID

The supported show grid options.

FIG_SIZE

The predefined figure sizes.

Examples:

>>> from datachart.constants import FIG_SIZE
>>> FIG_SIZE.DEFAULT
(6.4, 4.8)
ATTRIBUTE DESCRIPTION
DEFAULT

The default figure size. Equals to (6.4, 4.8).

TYPE: Tuple[float, float]

A4

The A4 figure size. Equals to (8.2, 11.6).

TYPE: Tuple[float, float]

A4_NARROW

The flat, full-width figure size. Equals to (8.2, 2.4).

TYPE: Tuple[float, float]

A4_REGULAR

The regular, full-width figure size. Equals to (8.2, 4.8).

TYPE: Tuple[float, float]

A4_WIDE

The tall, full-width figure size. Equals to (8.2, 7.2).

TYPE: Tuple[float, float]

SQUARE

The regular square figure size. Equals to (6.4, 6.4).

TYPE: Tuple[float, float]

SQUARE_SMALL

The small square figure size. Equals to (4.8, 4.8).

TYPE: Tuple[float, float]

SQUARE_LARGE

The large square figure size. Equals to (8.2, 8.2).

TYPE: Tuple[float, float]

FIG_FORMAT

The supported figure formats.

Examples:

>>> from datachart.constants import FIG_FORMAT
>>> FIG_FORMAT.DEFAULT
"png"
ATTRIBUTE DESCRIPTION
DEFAULT

The default format. Same as FIG_FORMAT.PNG.

TYPE: str

SVG

The svg format. Equals to "svg".

TYPE: str

PDF

The pdf format. Equals to "pdf".

TYPE: str

PNG

The png format. Equals to "png".

TYPE: str

WEBP

The webp format. Equals to "webp".

TYPE: str

FONT_STYLE

The supported font styles.

Examples:

>>> from datachart.constants import FONT_STYLE
>>> FONT_STYLE.DEFAULT
"normal"
ATTRIBUTE DESCRIPTION
DEFAULT

The default font style. Same as FONT_STYLE.NORMAL.

TYPE: str

NORMAL

The normal font style. Equals to "normal".

TYPE: str

ITALIC

The italic font style. Equals to "italic".

TYPE: str

OBLIQUE

The oblique font style. Equals to "oblique".

TYPE: str

FONT_WEIGHT

The supported font weights.

Examples:

>>> from datachart.constants import FONT_WEIGHT
>>> FONT_WEIGHT.DEFAULT
"normal"
ATTRIBUTE DESCRIPTION
DEFAULT

The default font weight. Same as FONT_WEIGHT.NORMAL.

TYPE: str

ULTRA_LIGHT

The ultra light font weight. Equals to "ultralight".

TYPE: str

LIGHT

The light font weight. Equals to "light".

TYPE: str

NORMAL

The normal font weight. Equals to "normal".

TYPE: str

BOLD

The bold font weight. Equals to "bold".

TYPE: str

HEAVY

The heavy font weight. Equals to "heavy".

TYPE: str

ULTRA_HEAVY

The ultra heavy font weight. Equals to "ultrabold".

TYPE: str

LINE_MARKER

The supported line markers.

Examples:

>>> from datachart.constants import LINE_MARKER
>>> LINE_MARKER.PIXEL
","
ATTRIBUTE DESCRIPTION
PIXEL

The pixel line marker. Equals to ",".

TYPE: str

POINT

The point line marker. Equals to ".".

TYPE: str

CIRCLE

The circle line marker. Equals to "o".

TYPE: str

TRIANGLE

The triangle line marker. Equals to "^".

TYPE: str

SQUARE

The square line marker. Equals to "s".

TYPE: str

PENTAGON

The pentagon line marker. Equals to "p".

TYPE: str

HEXAGON

The hexagon line marker. Equals to "h".

TYPE: str

STAR

The star line marker. Equals to "*".

TYPE: str

CROSS

The cross line marker. Equals to "x".

TYPE: str

PLUS

The plus line marker. Equals to "+".

TYPE: str

LINE_STYLE

The supported line styles.

Examples:

>>> from datachart.constants import LINE_STYLE
>>> LINE_STYLE.SOLID
"-"
ATTRIBUTE DESCRIPTION
SOLID

The solid line style. Equals to "-".

TYPE: str

DASHED

The dashed line style. Equals to "--".

TYPE: str

DASHDOT

The dashdot line style. Equals to "-.".

TYPE: str

DOTTED

The dotted line style. Equals to ":".

TYPE: str

LINE_DRAW_STYLE

The supported line draw styles.

Examples:

>>> from datachart.constants import LINE_DRAW_STYLE
>>> LINE_DRAW_STYLE.DEFAULT
"default"
ATTRIBUTE DESCRIPTION
DEFAULT

The default line draw style. Equals to "default".

TYPE: str

STEPS

The steps line draw style. Equals to "steps-pre".

TYPE: str

STEPS_PRE

The pre-steps line draw style. Equals to "steps-pre".

TYPE: str

STEPS_MID

The mid-steps line draw style. Equals to "steps-mid".

TYPE: str

STEPS_POST

The post-steps line draw style. Equals to "steps-post".

TYPE: str

HATCH_STYLE

The supported hatch styles.

Examples:

>>> from datachart.constants import HATCH_STYLE
>>> HATCH_STYLE.DEFAULT
None
ATTRIBUTE DESCRIPTION
DEFAULT

The default hatch style. Equals to None.

TYPE: str

DIAGONAL

The diagonal hatch style. Equals to "/".

TYPE: str

VERTICAL

The vertical hatch style. Equals to "|".

TYPE: str

HORIZONTAL

The horizontal hatch style. Equals to "-".

TYPE: str

CROSSED

The crossed hatch style. Equals to "+".

TYPE: str

CROSSED_DIAGONAL

The crossed diagonal hatch style. Equals to "x".

TYPE: str

DOTS

The dots hatch style. Equals to ".".

TYPE: str

CIRCLES

The circles hatch style. Equals to "o".

TYPE: str

STARS

The stars hatch style. Equals to "*".

TYPE: str

LEGEND_ALIGN

The supported legend alignments.

Examples:

>>> from datachart.constants import LEGEND_ALIGN
>>> LEGEND_ALIGN.DEFAULT
"left"
ATTRIBUTE DESCRIPTION
DEFAULT

The default legend alignment. Same as LEGEND_ALIGN.LEFT.

TYPE: str

CENTER

The center legend alignment. Equals to "center".

TYPE: str

RIGHT

The right legend alignment. Equals to "right".

TYPE: str

LEFT

The left legend alignment. Equals to "left".

TYPE: str

HISTOGRAM_TYPE

The supported histogram types.

Examples:

>>> from datachart.constants import HISTOGRAM_TYPE
>>> HISTOGRAM_TYPE.BAR
"bar"
ATTRIBUTE DESCRIPTION
BAR

The bar histogram style. Equals to "bar".

TYPE: str

STEP

The step histogram style. Equals to "step".

TYPE: str

STEPFILLED

The stepfilled histogram style. Equals to "stepfilled".

TYPE: str

COLORS

The predefined colors.

Examples:

>>> from datachart.constants import COLORS
>>> COLORS.Blue
'blue'
ATTRIBUTE DESCRIPTION
Blue

The single-hue blue color. Equals to "blue".

TYPE: str

Green

The single-hue green color. Equals to "green".

TYPE: str

Orange

The single-hue orange color. Equals to "orange".

TYPE: str

Purple

The single-hue purple color. Equals to "purple".

TYPE: str

Grey

The single-hue grey color. Equals to "grey".

TYPE: str

YlGnBu

The multi-hue yellow-green-blue colors. Equals to "ylgnbu".

TYPE: str

YlGn

The multi-hue yellow-green colors. Equals to "ylgn".

TYPE: str

BuGn

The multi-hue blue-green colors. Equals to "bugn".

TYPE: str

GnBu

The multi-hue green-blue colors. Equals to "gnbu".

TYPE: str

PuBu

The multi-hue purple-blue colors. Equals to "pubu".

TYPE: str

RdPu

The diverging red-purple colors. Equals to "rdbn".

TYPE: str

RdYlBu

The diverging red-yellow-blue colors. Equals to "rdylbu".

TYPE: str

BrNg

The diverging brown-grey colors. Equals to "brng".

TYPE: str

PuGn

The diverging purple-green colors. Equals to "pugn".

TYPE: str

OrPu

The diverging orange-purple colors. Equals to "puor".

TYPE: str

RdGy

The diverging red-gray colors. Equals to "rdgy".

TYPE: str

RdYlGn

The diverging red-yellow-green colors. Equals to "rdylgn".

TYPE: str

Spectral

The diverging spectral colors. Equals to "spectral".

TYPE: str

MixedLight

The quantitative light color mix. Equals to "mixed_light".

TYPE: str

MixedDark

The quantitative dark color mix. Equals to "mixed_dark".

TYPE: str

NORMALIZE

The supported normalization options.

Examples:

>>> from datachart.constants import NORMALIZE
>>> NORMALIZE.LINEAR
"linear"
ATTRIBUTE DESCRIPTION
LINEAR

The linear normalization. Equals to "linear".

TYPE: str

LOG

The logistic normalization. Equals to "log".

TYPE: str

SYMLOG

The symlog normalization. Equals to "symlog".

TYPE: str

ASINH

The asinh normalization. Equals to "asinh".

TYPE: str

LOGIT

The logit normalization. Equals to "logit".

TYPE: str

ORIENTATION

The supported orientations.

Examples:

>>> from datachart.constants import ORIENTATION
>>> ORIENTATION.HORIZONTAL
"horizontal"
ATTRIBUTE DESCRIPTION
HORIZONTAL

The horizontal orientation. Equals to "horizontal".

TYPE: str

VERTICAL

The vertical orientation. Equals to "vertical".

TYPE: str

VALFMT

The predefined value formats.

Examples:

>>> from datachart.constants import VALFMT
>>> VALFMT.DEFAULT
"{x}"
ATTRIBUTE DESCRIPTION
DEFAULT

The default value format. Equals to "{x}".

TYPE: str

INTEGER

The integer value format. Equals to "{x:d}".

TYPE: str

DECIMAL

The decimal value format. Equals to "{x:.1f}".

TYPE: str

PERCENT

The percentage value format. Equals to "{x:.1%}".

TYPE: str

THEME

The predefined themes.

Examples:

>>> from datachart.constants import THEME
>>> THEME.DEFAULT
"default"
ATTRIBUTE DESCRIPTION
DEFAULT

The default theme. Equals to "default".

TYPE: str

GREYSCALE

The greyscale theme. Equals to "greyscale".

TYPE: str

SHOW_GRID

The supported show grid options.

Examples:

>>> from datachart.constants import SHOW_GRID
>>> SHOW_GRID.DEFAULT
None
ATTRIBUTE DESCRIPTION
DEFAULT

The default show grid. Same as SHOW_GRID.NONE.

TYPE: str

NONE

Do not show the grid. Equals to None.

TYPE: None

X

Show the x-axis grid. Equals to "x".

TYPE: str

Y

Show the y-axis grid. Equals to "y".

TYPE: str

BOTH

Show both the x- and y-axis grid. Equals to "both".

TYPE: str

SCALE

The supported scale options.

Examples:

>>> from datachart.constants import SCALE
>>> SCALE.DEFAULT
"linear"
ATTRIBUTE DESCRIPTION
DEFAULT

The default scale. Same as SCALE.LINEAR.

TYPE: str

LINEAR

The linear scale. Equals to "linear".

TYPE: str

LOG

The log scale. Equals to "log".

TYPE: str

SYMLOG

The symlog scale. Equals to "symlog".

TYPE: str

LOGIT

The logit scale. Equals to "logit".

TYPE: str

ASINH

The asinh scale. Equals to "asinh".

TYPE: str