Skip to main content
196

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Apple docs
Data displayApple

Dumbbell chart

Compare two measurements per category with connected dots.

Public APILumenDumbbellChartApple / SwiftUISwift product: LumenUI

Apple availability

Supported native targets

Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.

iPhone · iOS 16+iPad · iPadOS 16+Mac · macOS 13+Apple TV · tvOS 16+Apple Vision · visionOS 1+Apple Watch · watchOS 9+

Native example

Use Dumbbell chart

Preserve missing measurements as null and provide a zero-inclusive domain. The application owns row ordering.

Dumbbell chart rendered in the iPhone simulator Lumen playground
Captured exampleiPhone simulator
swift
LumenDumbbellChart(
  data: [
    .init(id: "design", label: "Design", value: 88, reference: 62),
    .init(id: "support", label: "Support", value: 74, reference: 81)
  ],
  label: "Team scores, previous and current quarter",
  domain: 0...100,
  heading: "Progress by team",
  referenceLabel: "Previous",
  valueLabel: "Current"
)

Reference

Public API

The primary shared and platform-specific options exposed by LumenDumbbellChart.

APIValues or typeDefaultDescription
dataLumenComparisonDatum[]RequiredUnique id, category label, nullable finite value, optional reference and tone. Input order is preserved.
label, heading, descriptionStringlabel requiredProvides the accessible name and optional visible context.
domainFinite numeric rangeAutomaticIncludes zero and all displayed measurements. React Native uses { min, max }; SwiftUI and Compose use closed ranges.
valueLabel, labelsLocalized chart labelsEnglishNames the measure and localizes empty, missing, invalid, and disclosure text. DumbbellChart also accepts referenceLabel (Before).
formatValue / labels.formatValueNumber formatterPlatform defaultReact Native accepts formatValue; SwiftUI and Compose use labels.formatValue.
showDataBooleantrueProvides the expandable exact values.

Native behavior

Design and accessibility

When to use it

Preserve missing measurements as null and provide a zero-inclusive domain. The application owns row ordering.

Accessibility

Keeps exact values available and uses filled and outlined dots for paired measurements.

Shared component

Available on other platforms

React NativeAndroid / Compose
Apple docsSwiftUI package