TechnologiesUI & App Frameworks

Charts

iOSmacOStvOSwatchOSvisionOS

Charts is a SwiftUI framework for building declarative, data-driven charts and graphs across iOS, macOS, tvOS, watchOS, and visionOS. You compose visualizations from marks and plots such as BarPlot, LinePlot, AreaPlot, and PointPlot, conform your data to Plottable and pass it through PlottableValue, and configure axes with AxisMarks, AxisGridLine, AxisTick, and AxisValueLabel. The framework gives you fine control over presentation through types like AnnotationContext and AnnotationOverflowResolution for annotations, AxisValueLabelCollisionResolution for overlapping labels, ChartBinRange, DateBins, and NumberBins for binning, and ChartProxy for reading chart geometry. Three-dimensional charting is supported through Chart3DPose, Chart3DSurfaceStyle, and Chart3DSymbolShape, while ChartScrollTargetBehavior handles scrolling behavior.

Marks and Plots 8

Vectorized plot content that draws your data as bars, lines, areas, points, and other graphical marks.

  • St
    BarPlotiOS 18.0+
    Chart content that represents a collection of data using bars.
  • St
    LinePlotiOS 18.0+
    Chart content that represents a function or a collection of data using a sequence of connected line segments.
  • St
    AreaPlotiOS 18.0+
    Chart content that represents a function or a collection of data using the area of one or more regions.
  • St
    PointPlotiOS 18.0+
    Chart content that represents a collection of data using points.
  • St
    RectanglePlotiOS 18.0+
    Chart content that represents a collection of data using rectangles.
  • St
    RulePlotiOS 18.0+
    Chart content that represents a collection of data using a single horizontal or vertical rule.
  • St
    SectorPlotiOS 18.0+
    Chart content that represents a collection of data using a sector of a pie or donut chart,
  • Pr
    VectorizedChartContentiOS 18.0+
    A generic type that represents content conveyed via a chart.

Plottable Data 4

Protocols and values that adapt your model data into quantities a chart can position and scale.

  • Pr
    PlottableiOS 16.0+
    A type that can serve as data to plot in a chart.
  • St
    PlottableValueiOS 16.0+
    Labeled data that you plot in a chart using marks.
  • Pr
    PrimitivePlottableProtocoliOS 16.0+
    A type that represents the primitive plottable types supported by the framework. Don't use this
  • St
    PlottableProjectioniOS 18.0+
    A structure that projects plottable values into a chart's coordinate space.

Axes 12

Types for composing and presenting chart axes, including grid lines, ticks, and value labels.

  • Pr
    AxisContentiOS 16.0+
    A type that represents the elements you use to build a chart's axes.
  • Pr
    AxisMarkiOS 16.0+
    A type that serves as the basic building block for the elements of an axis.
  • St
    AxisMarksiOS 16.0+
    A group of visual marks that a chart draws to indicate the
  • St
    AxisGridLineiOS 16.0+
    A line that a chart draws across its plot area to indicate a reference point
  • St
    AxisTickiOS 16.0+
    A mark that a chart draws on an axis to indicate a reference point along that axis.
  • St
    AxisValueiOS 16.0+
    A value for an axis mark.
  • St
    AxisValueLabeliOS 16.0+
    A label that describes the value for an axis mark.
  • St
    AxisMarkPositioniOS 16.0+
    Describes the position of axis markers.
  • St
    AxisMarkPresetiOS 16.0+
    Describes preset styles for axis markers.
  • St
    AxisMarkValuesiOS 16.0+
    Describes the values the axis markers will present (one for each value).
  • St
    AxisValueLabelOrientationiOS 16.0+
    Describes the orientation of a label.
  • St
    AxisValueLabelCollisionResolutioniOS 16.0+
    A structure that specifies how to resolve overlapping axis value labels.

Scales 7

Protocols and types that map data domains onto the visual range of a plot.

  • Pr
    ScaleDomainiOS 16.0+
    A type that you can use to configure the domain of a chart.
  • Pr
    ScaleRangeiOS 16.0+
    A type that you can use to configure the range of a chart.
  • St
    ScaleTypeiOS 16.0+
    The ways you can scale the domain or range of a plot.
  • St
    AutomaticScaleDomainiOS 16.0+
    A domain that the chart infers from its data.
  • Pr
    PositionScaleRangeiOS 16.0+
    A type that configures the x-axis and y-axis values.
  • St
    PlotDimensionScaleRangeiOS 16.0+
    A range that represents the plot area's width or height.
  • St
    MarkDimensionsiOS 18.0+
    A structure that describes the width and height dimensions of a chart mark.

Binning 3

Types that group continuous numeric and date values into discrete bins for aggregation.

  • St
    ChartBinRangeiOS 16.0+
    The range of data that a single bin of a chart represents.
  • St
    DateBinsiOS 16.0+
    A collection of bins for a chart that plots data against dates.
  • St
    NumberBinsiOS 16.0+
    A collection of bins for a chart that plots data against numbers.

Annotations 4

Types that position annotations on marks and resolve them when they overflow the plot area.

  • St
    AnnotationContextiOS 16.0+
    Information about an item that you add an annotation to.
  • St
    AnnotationPositioniOS 16.0+
    The position of an annotation.
  • St
    AnnotationOverflowResolutioniOS 17.0+
    A structure that specifies how to reposition an annotation when it extends beyond the plot area.
  • St
    MajorValueAlignmentiOS 17.0+
    A type that defines how the valigned aligned chart scroll target behavior aligns to major values on swipe.

Symbol Shapes 2

Protocols and shapes that define the symbols used to render point and line marks.

  • Pr
    ChartSymbolShapeiOS 16.0+
    A type that can act as a shape for the marks that you add to a chart.
  • St
    BasicChartSymbolShapeiOS 16.0+
    A basic chart symbol shape.

Three-Dimensional Charts 6

Types for building, posing, styling, and shaping spatial charts in three dimensions.

  • St
    Chart3DPose
    A structure that describes the camera orientation and viewing pose of a three-dimensional chart.
  • St
    Chart3DRenderingStyle
    A structure that specifies the rendering style applied to a three-dimensional chart.
  • Pr
    Chart3DSurfaceStyle
    A type that defines the visual style of a surface in a three-dimensional chart.
  • St
    BasicChart3DSurfaceStyle
    A structure that provides a standard surface style for three-dimensional charts.
  • Pr
    Chart3DSymbolShape
    A type that can act as a shape for the marks that you add to a chart.
  • St
    BasicChart3DSymbolShape
    A basic chart symbol shape.

Reading Chart Geometry and Scrolling 4

Types for inspecting chart layout at runtime and controlling value-aligned scrolling behavior.

  • St
    ChartProxyiOS 16.0+
    A proxy that you use to access the scales and plot area of a chart.
  • Pr
    ChartScrollTargetBehavioriOS 17.0+
    A type that configures the scroll behavior of charts.
  • St
    ValueAlignedChartScrollTargetBehavioriOS 17.0+
    A scroll target behavior that aligns to values spaced at regular intervals along the scrollable axes.
  • St
    ValueAlignedLimitBehavioriOS 17.0+
    A type that defines the amount of marks that can be scrolled at a time.

Structures 35

  • St
    AnyAxisContentiOS 16.0+
    A type-erased element of a chart's axis.
  • St
    AnyAxisMarkiOS 16.0+
    A type-erased axis mark.
  • St
    AnyChartContentiOS 16.0+
    A type-erased chart content.
  • St
    AnyChartSymbolShapeiOS 16.0+
    A type-erased plotting shape.
  • St
    AreaMarkiOS 16.0+
    Chart content that represents data using the area of one or more regions.
  • St
    AxisContentBuilderiOS 16.0+
    A result builder that constructs axis content.
  • St
    AxisMarkBuilderiOS 16.0+
    A result builder that constructs axis marks and overrides default marks.
  • St
    BarMarkiOS 16.0+
    Chart content that represents data using bars.
  • St
    BuilderConditionaliOS 16.0+
    A conditional result from a result builder.
  • St
    ChartiOS 16.0+
    A SwiftUI view that displays a chart.
  • St
    Chart3D
    A SwiftUI view that displays interactive 3D charts and visualizations.
  • St
    Chart3DContentBuilder
  • St
    ChartAxisContentiOS 17.0+
    A view that represents a chart's axis.
  • St
    ChartContentBuilderiOS 16.0+
    A result builder that you use to compose the contents of a chart.
  • St
    ChartPlotContentiOS 16.0+
    A view that represents a chart's plot area.
  • St
    ChartScrollTargetBehaviorContextiOS 17.0+
    Contextual information that you can use to determine how to best adjust how charts scroll.
Show 19 more
  • St
    FunctionAreaPlotContentiOS 18.0+
  • St
    FunctionLinePlotContentiOS 18.0+
  • St
    InterpolationMethodiOS 16.0+
    The ways in which line or area marks interpolate their data.
  • St
    LineMarkiOS 16.0+
    Chart content that represents data using a sequence of connected line segments.
  • St
    MarkDimensioniOS 16.0+
    An individual dimension representing a mark's width or height.
  • St
    MarkStackingMethodiOS 16.0+
    The ways in which you can stack marks in a chart.
  • St
    PlotiOS 16.0+
    A mechanism for grouping chart contents into a single entity.
  • St
    PointMarkiOS 16.0+
    Chart content that represents data using points.
  • St
    RectangleMarkiOS 16.0+
    Chart content that represents data using rectangles.
  • St
    RuleMarkiOS 16.0+
    Chart content that represents data using a single horizontal or vertical rule.
  • St
    SectorMarkiOS 17.0+
    A sector of a pie or donut chart, which shows how individual categories make up a meaningful total.
  • St
    SurfacePlot
    Chart content that represents a mathematical function of two variables using a 3D surface.
  • St
    VectorizedAreaPlotContentiOS 18.0+
    An opaque vectorized chart content type.
  • St
    VectorizedBarPlotContentiOS 18.0+
    An opaque vectorized chart content type.
  • St
    VectorizedLinePlotContentiOS 18.0+
    An opaque vectorized chart content type.
  • St
    VectorizedPointPlotContentiOS 18.0+
    An opaque vectorized chart content type.
  • St
    VectorizedRectanglePlotContentiOS 18.0+
    An opaque vectorized chart content type.
  • St
    VectorizedRulePlotContentiOS 18.0+
    An opaque vectorized chart content type.
  • St
    VectorizedSectorPlotContentiOS 18.0+
    An opaque vectorized chart content type.

Protocols 2

  • Pr
    Chart3DContent
  • Pr
    ChartContentiOS 16.0+
    A type that represents the content that you draw on a chart.

Extends 31

OptionalForEachNeverModifiedContentViewEmptyViewTupleContentViewBuilderPagingScrollTargetBehaviorCircleDoubleStringDateFloat16FloatDecimalIntInt8Int16Int32Int64UIntUInt8UInt16UInt32UInt64ClosedRangeArrayArraySliceGradientAnyGradient
← UI & App Frameworks