role, aria-label, aria-roledescription) remain in the DOM for accessibility, but they are not a styling API; selectors should use the hooks below.
Parts
Each part carries a classname; the data attributes present on a part are listed in the next section.Data attributes
Prefer
data-graphy-orientation over enumerating bar types when a rule only cares about direction. On grid lines, the axis side tells you the line’s direction: left/right grid lines run horizontally, top/bottom ones vertically.
Series identity
data-graphy-series-index is the 0-based position of the series in data order: the order series first appear in the data, honoring an explicit series order when one is configured. The same value is stamped on a series’ shapes (bars, lines, areas, slices, points) and on its legend item, so match them by attribute, not by visual position:
- Combo charts move line series to the end of the legend visually; the attribute still matches the shapes.
- Hiding a series does not shift the other series’ indices.
- Hover highlighting reorders line z-position without touching the attribute.
Examples
Text size
Chart text is sized inem, relative to a base controlled by appearance.textScale. Your CSS can pin exact pixel sizes per element:
!important so your rule wins over the chart’s own styles.
Programmatic access
If you generate CSS or selectors in code, import the names instead of hardcoding strings.GRAPHY_PART_CLASSNAMES maps part keys to classnames, GRAPHY_DATA_ATTRIBUTES maps value keys to attribute names, and getChartOrientation(chartType) returns the same 'horizontal' | 'vertical' | undefined the chart stamps as data-graphy-orientation. That’s useful when you know a chart’s type and want to branch on its orientation without touching the DOM.

