This chapter is provided as a free sample for Swift Charts Beyond the Basics book.
You can read this chapter online or download the sample bundle with PDF and EPUB by clicking the link below.
Download free sampleTo get access to the contents of the whole book you need to purchase a copy.
FREE SAMPLE - online version
Arranging chart content
Where chart content appears is determined by more than the horizontal and vertical values supplied to each mark or plot. Swift Charts can divide one position among subcategories, combine several values into a shared stack, or place aggregated observations across a two-dimensional domain. These arrangements determine which observations are compared directly and whether a visible extent represents an individual value, a contribution to a total, or a region of the data.
Some arrangements follow from grouping and stacking values that Swift Charts resolves across the complete composition. Others require us to derive positions from the data, such as mapping recurring times onto a shared reference or converting grid coordinates into cell centers. In both cases, the arrangement needs to retain the original categorical, temporal, or spatial relationships while making the intended comparison possible.
Categorical grouping and stacking establish how several observations can share a primary position or contribute to a common extent. Calendar layouts and heat-map grids extend this positional reasoning to recurring periods and two-dimensional regions. Understanding how each arrangement relates source values to a shared coordinate space lets us control the chart's positions and extents without losing the relationships the data describes.