Contents

RectanglePlot

Chart content that represents a collection of data using rectangles.

Declaration

struct RectanglePlot<Content>

Overview

Use RectanglePlot when you want to visualize data in the same way as with RectangleMark, but you want to visualize an entire data collection with a single plot.

You can initialize and style the plot with simple values or key paths. Add modifiers with KeyPath before adding modifiers with simple values.

Chart {
    RectanglePlot(
        tasks,
        x: .value("Time", \.startTime, \.endTime),
        y: .value("Project", \.project)
    )
    .foregroundStyle(by: .value("Status", \.status))
    .cornerRadius(4)
}

Topics

Plotting rectangles from a collection

Supporting types

See Also

Vectorized plots