For AI agents: the complete XY documentation index is at llms.txt. Markdown versions are available by appending .md or sending Accept: text/markdown.
Api Reference

/

Chart Factories

Chart Factories

Chart factories compose marks, axes, annotations, and chrome into a public Chart. The generated inventory below is organized by chart family; use the Chart Gallery when visual browsing is more helpful. 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.

Polar

xy.polar_chart

A polar chart: the same marks, rendered through polar coordinates.

Props

PropTypeDescription
*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.radar_chart

A radar (spider) chart: one closed polygon per series.

Props

PropTypeDescription
categoriesSequence[str]

Spoke labels, one per value.

*childrenComponent

`area` (filled) or `line` (outline) marks carrying values, plus any axis/legend children.

fillbool

When False, filled `area` children are rebuilt as `line` outlines, so one call switches a whole chart between filled and outline radar without editing every mark.

**propsAny

Any `polar_chart` keyword.

xy.polar_bar_chart

Radial bars: each bar is an annular sector rather than a rectangle.

Props

PropTypeDescription
*childrenComponent

`bar` marks plus axis/legend children.

**propsAny

Any `polar_chart` keyword.

xy.pie_chart

A pie or donut: one slice per label, sized by value.

Props

PropTypeDescription
labelsSequence[Any]

One category name per slice.

valuesArrayLike

One non-negative value per slice.

*childrenComponent

Extra components (legend placement, a user tooltip, …).

holefloat

Inner radius fraction; 0 is a full pie, the default is a donut.

padfloat

Gap between neighbouring slices, in PIXELS — constant from the hole to the rim. An angular pad would be `r · dtheta` wide and so taper to nothing toward the centre, which reads as the spacing being applied unevenly across the slice.

colorsOptional[Sequence[str]]

One CSS colour per slice. Defaults to the palette cycle.

corner_radiusfloat

Rounded slice corners, in px.

show_valuesbool

Include the value in the slice's name (legend + tooltip). Dropped for a slice whose value renders identically to its share — percentage-shaped input would otherwise print the same number twice.

show_percentbool

Include the share in the slice's name (legend + tooltip).

**propsAny

Any `polar_chart` keyword (`width`, `height`, `title`, …).

xy.wind_rose

A wind rose: directional frequency, stacked by speed band.

Props

PropTypeDescription
directionsArrayLike

Bearings in degrees, one per observation.

speedsArrayLike

Speeds, one per observation.

*children_inComponent

Extra components — an `xy.legend`, or an `xy.tooltip` to replace the default direction/count readout.

sectorsint

Number of angular bins around the circle.

speed_binsOptional[Sequence[float]]

Upper edges of the speed bands. Defaults to four quartile bands derived from the data. Each band takes the next colour from the chart's palette cycle, as stacked series do everywhere else.

**propsAny

Any `polar_chart` keyword.

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.sankey_chart

A Sankey diagram chart: flow layout, gradient ribbons, hidden axes.

Props

PropTypeDescription
linksAny

Defaults to None.

*childrenComponent

Additional positional arguments.

**propsAny

Additional keyword arguments.

xy.funnel_chart

A funnel chart: ordered stages, centered segments, hidden cross axis.

Props

PropTypeDescription
*childrenAny

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. Defaults to on for Cartesian charts and off for polar ones (`wind_rose` excepted);

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.

coordsstr

Coordinate system, ``"cartesian"`` (default) or ``"polar"``. Under ``"polar"`` each mark's first channel is the angle and its second is the radius. Prefer ``xy.polar_chart(...)``, which sets this for you.

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