Axis
Most charts use a Cartesian coordinate system, with a vertical y-axis and a horizontal x-axis. Every axis uses a categorical, ordinal, interval, or ratio


Table of contents#
Anatomy#


Options#
Behaviors#

Labels#
Show all labels on a categorical axis. Some labels can be dropped from an ordinal axis. Depending on screen size, only show 3-5 labels on an interval or a ratio axis.
For ticks, labels aren’t always needed, especially when they risk affecting chart legibility.

Grid lines and and small ticks#
Always show ticks and grid lines for interval and ratio axis labels.

Extra-small ticks#
Extra-small ticks can be included to illustrate meaningful points along interval and ratio axis labels. Show between 3-9 extra-small ticks between small ticks.

Overflow#
When there are more items in a categorical axis than can be shown, don’t exclude them. Instead, add an axis label (which can be an interactive link) that covers the sum, count, or average of all remaining items.

Interaction#
In most cases, axes are not directly interactive. They don’t have focus, selected, or hover states.
Usage guidelines#
Include an axis title#
An axis should have a title. Exceptions include when the scales of an axis are self-evident (e.g., time), or are captured in the chart title and therefore don’t need to be displayed.


Drop the axis title when a chart title will suffice. Include an axis title when there is no chart title.
Keep ticks and labels clean#
Design an axis with a focus on clear communication. Ticks can be used without labels, but labels should never be used without ticks. Most charting libraries have default logic that generates clean ticks and labels.
Dimensions (categorical and ordinal scales) should not have axis ticks. The text itself is sufficient for proper identification.




Use an interval scale for time#
Time can be represented on an ordinal or an interval scale, but it’s usually best to use an interval scale to ensure an accurate and intuitive representation. For example, using a “month” category can be misleading because months aren’t always equal in length (they vary from 28-31 days).




Put time on the x-axis#
Represent time on the x-axis, from left to right. Avoid mapping time to colors, sizes, or angles.




Put categories on the y-axis#
It can be difficult to read vertical text. Keep categories on the y-axis whenever possible.




Abbreviate axis labels that are numbers#
For axis labels that are numbers, abbreviate using localized abbreviations whenever possible, and also keep readability in mind. For the best readability of large, round numbers, spell out the word (e.g., 4 thousand, 2.5 billion). In English, you can also use the abbreviations of K for thousands, M for millions, and B for billions, capitalized and with no punctuation (e.g., 71M records).




Changelog#
- Updated all colors to 6.0.0
- This component has been added to the website
Design checklist#
All interactive states
Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).

All color themes
Works properly across all four color themes (lightest, light, dark, darkest).

All platform scales
Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).
Accessible use of color
Color is not used as the only visual means of conveying information (WCAG 2.0 1.4.1).

Accessible contrast for text
Text has a contrast ratio of at least 4.5:1 for small text and at least 3:1 for large text (WCAG 2.0 1.4.3).

Accessible contrast for UI components
Visual information required to identify components and states (except inactive components) has a contrast ratio of at least 3:1 (WCAG 2.1 1.4.11).

Content design
UI language and information design considerations have been incorporated into component design.

Defined options
Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)

Defined behaviors
Includes guidelines for keyboard focus, layout (wrapping, truncation, overflow), animation, interactions, etc.

Usage guidelines
Includes a list of dos and don'ts that highlight best practices and common mistakes.

Writing guidelines
Includes content standards or usage guidelines for how to write or format in-product content for the component.

Internationalization guidelines
Works properly across various locales and includes guidelines for bi-directionality (RTL).
Keyboard interactions
Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.

Design tokens
All design attributes (color, typography, layout, animation, etc.) are available as design tokens.

UI kit
Includes a downloadable XD file that shows multiple options, states, color themes, and platform scales.

Generated UI kit
Includes a downloadable XD file, generated by code using design tokens defined in Spectrum DNA, and shows multiple options, states, color themes, and platform scales.

In Spectrum for Adobe XD plugin
Component is included in the Spectrum for Adobe XD plugin.