Api Reference

/

Chart Factories

Chart Factories

Chart factories compose marks, axes, annotations, and chrome into a public Chart. The generated inventory below follows the same taxonomy as the Chart Gallery. Its names, signatures, and defaults come directly from XY's public Python callables.

Use chart() when different mark kinds share a panel. A family container is usually clearer when the children represent one chart family.

Generated Factory API

Line and Area

xy.line_chart

A line chart composing `line` marks and axis/legend children.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.area_chart

An area chart composing `area` marks and axis/legend children.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.step_chart

A step chart composing `step` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.stairs_chart

A stairs chart composing `stairs` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Scatter

xy.scatter_chart

A scatter chart composing `scatter` marks and axis/legend children.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Bar and Column

xy.bar_chart

A bar chart composing `bar` marks and axis/legend children.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.column_chart

A column chart composing `column` marks and axis/legend children.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Distributions

xy.histogram_chart

A histogram chart composing `histogram` marks and axis/legend children.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.ecdf_chart

An ECDF chart composing `ecdf` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.box_chart

A box/distribution chart composing `box` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.violin_chart

A violin chart composing `violin` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Density and Grids

xy.hexbin_chart

A hexbin chart composing `hexbin` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.heatmap_chart

A heatmap chart composing `heatmap` marks and axis/legend children.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.contour_chart

A contour chart composing `contour` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Uncertainty

xy.error_band_chart

An uncertainty-band chart composing `error_band` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.errorbar_chart

An error-bar chart composing `errorbar` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Specialized

xy.stem_chart

A stem chart composing `stem` marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.segments_chart

A segment chart composing generic independent segment marks.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.triangle_mesh_chart

A filled triangular mesh chart.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Annotations

xy.chart

A neutral single-panel chart for overlays and mixed mark composition.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

Facets and Layers

xy.chart

A neutral single-panel chart for overlays and mixed mark composition.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.facet_chart

Repeat the child mark composition once per value of ``by``.

Props

PropTypeDescription
*childrenComponent

Marks, axes, annotations, and chart chrome for each panel.

byUnion[str, ArrayLike, None]

Facet values or a column name resolved from chart-level data.

colsint

Maximum number of panel columns.

share_xbool

Whether panels share an x domain.

share_ybool

Whether panels share a y domain.

linkOptional[Union[str, bool]]

Runtime-linked axes: ``True``/``"both"`` for both axes, ``"x"`` or ``"y"`` for one axis, and ``False``/``None`` to disable.

link_selectbool

Whether data-space selections are echoed across panels.

gapint

Gap between panels in pixels.

**propsAny

Additional shared chart properties. ``width`` is the total grid width, while ``height`` is the height of each panel; the composed height grows with the number of facet rows.

Annotation-only compositions use the neutral chart() container, so that factory appears under Annotations. It also appears beside facet_chart() in Facets and Layers because layered marks use the same neutral container.

Shared Chart Props

Shared chart props

Initialize a chart composition.

Props

PropTypeDescription
childrentuple[Component, ...]

Marks, axes, annotations, and chart chrome.

titleOptional[str]

Title shown above the plot.

widthint | str

Chart width in pixels or a CSS size such as ``"100%"``.

heightint | str

Chart height in pixels or a CSS size such as ``"100%"``.

paddingUnion[float, Sequence[float], None]

Plot margins, as one value or a sequence of side values. Use zero for an edge-to-edge sparkline.

dataTableLike

Chart-level data used by marks that omit their own ``data``.

class_nameOptional[str]

CSS class applied to the chart container.

class_namesOptional[dict[str, str]]

CSS classes keyed by stable chart DOM slot.

styleOptional[dict[str, StyleValue]]

Inline style overrides for the chart container.

stylesOptional[dict[str, dict[str, StyleValue]]]

Inline style mappings keyed by stable chart DOM slot.

on_hoverOptional[Callable[[dict], None]]

Callback receiving hover event payloads.

on_clickOptional[Callable[[dict], None]]

Callback receiving picked-mark click payloads.

on_brushOptional[Callable[[dict], None]]

Callback receiving brush event payloads.

on_selectOptional[Callable[[Selection], None]]

Callback receiving data-space selections.

on_view_changeOptional[Callable[[dict], None]]

Callback receiving viewport change payloads.

hoverOptional[bool]

Whether pointer movement emits hover events.

clickOptional[bool]

Whether picked marks emit click events.

selectOptional[bool]

Whether shift-drag box selection is enabled.

brushOptional[bool]

Whether brush selection is enabled.

crosshairOptional[bool]

Whether plot-aligned hover guides are shown.

navigationOptional[bool]

Whether browser pan and zoom navigation is enabled.

panOptional[bool]

Whether plain-drag panning is enabled.

pan_axesOptional[tuple[str, ...]]

Declared axis IDs translated by pan gestures.

zoomOptional[bool]

Whether viewport zoom is enabled.

default_drag_actionOptional[DefaultDragAction]

Initial action performed by a plain plot drag.

zoom_axesOptional[tuple[str, ...]]

Declared axis IDs changed by zoom gestures and controls.

zoom_limitsOptional[ZoomLimits]

Minimum and maximum magnification globally or by axis.

wheel_zoomOptional[bool]

Whether wheel and trackpad zoom is available.

box_zoomOptional[bool]

Whether box zoom is available as a drag action.

zoom_buttonsOptional[bool]

Whether modebar Zoom In/Out commands are available.

double_click_resetOptional[bool]

Whether double-click restores ``reset_axes``.

reset_axesOptional[tuple[str, ...]]

Declared axis IDs restored by reset.

link_groupOptional[str]

Identifier used to synchronize charts in the browser.

link_axesOptional[tuple[str, ...]]

Axes synchronized within the link group.

The “Shared chart props” table is generated from the public Chart constructor. Every ordinary factory accepts those props through **props; facet_chart exposes its grid controls directly in its generated factory table and forwards the remaining props to each panel.

Facet Constraints

facet_chart requires by= values or a column name resolved from chart-level data=. Its width and height must be positive integer pixel counts; panel columns and gap are integers. Marks that use row-aligned raw channels must use compatible arrays or column names so each panel can be subset safely.

Shared facet axes coordinate panel domains and browser viewport changes. FacetChart supports display, export, and memory reporting, but does not expose Chart.append(), pick(), or select_range().

See Composition model for usage and Chart methods for the returned objects.

Built with Reflex