The guide is being migrated; some links to the API reference may be missing. Use the search bar in the API reference.

Axis

Overview

Axis draws an axis along one of a CartesianChart’s edges. There are two built-in implementations: HorizontalAxis and VerticalAxis. Numerous customization options are available—you can change the appearance of the labels, modify the axis lines, add titles, and more.

Learn about axes in Compose and in views.

ItemPlacer

HorizontalAxis.ItemPlacer and VerticalAxis.ItemPlacer let you customize for what x- and y-values labels and lines are displayed. Four factory functions are available:

  • HorizontalAxis.ItemPlacer.aligned (default)

  • HorizontalAxis.ItemPlacer.segmented

  • VerticalAxis.ItemPlacer.step (default)

  • VerticalAxis.ItemPlacer.count

Custom implementations can be created.

Sample charts

Last updated