To get access to the contents of the whole book you need to purchase a copy.
Representing values in charts
The marks and plots that form a chart receive values that connect the application’s data model to the chart’s visual and semantic structure. Swift Charts uses a numerical or categorical representation to place each value on a scale, while a semantic label identifies what the value means and the receiving API establishes its role within the composition. These parts remain distinct even when a value is transformed to change where the observation appears.
Numbers and strings can provide their chart representations directly, but other values require more context or an explicit representation. A date may identify an exact moment, a calendar-aligned period, or an arbitrary interval. A domain type such as a measurement needs a primitive representation that makes it plottable without discarding its unit and meaning. Charts that combine metrics extend the same idea by projecting values into a shared numerical space, while missing observations require us to decide whether they should interrupt connected content or preserve an empty position.
All of these cases depend on the distinction between the value Swift Charts plots and the meaning the chart must retain. This chapter first establishes that distinction through primitive representations, semantic labels, and chart roles, then applies it to temporal values, custom Plottable types, multiple metrics on one axis, and derived values in vectorized plots. We’ll finish by examining how missing values affect connected and independent chart content.