---
title: RectanglePlot
framework: charts
role: symbol
role_heading: Structure
path: charts/rectangleplot
---

# RectanglePlot

Chart content that represents a collection of data using rectangles.

## Declaration

```swift
struct RectanglePlot<Content>
```

## Overview

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

- [init(_:x:y:width:height:)](charts/rectangleplot/init(_:x:y:width:height:).md)
- [init(_:x:yStart:yEnd:width:)](charts/rectangleplot/init(_:x:ystart:yend:width:)-93op1.md)
- [init(_:x:yStart:yEnd:width:)](charts/rectangleplot/init(_:x:ystart:yend:width:)-nnvk.md)
- [init(_:x:yStart:yEnd:width:)](charts/rectangleplot/init(_:x:ystart:yend:width:)-12u1b.md)
- [init(_:xStart:xEnd:y:height:)](charts/rectangleplot/init(_:xstart:xend:y:height:)-51nra.md)
- [init(_:xStart:xEnd:y:height:)](charts/rectangleplot/init(_:xstart:xend:y:height:)-8s17v.md)
- [init(_:xStart:xEnd:y:height:)](charts/rectangleplot/init(_:xstart:xend:y:height:)-15ish.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/rectangleplot/init(_:xstart:xend:ystart:yend:)-46wi0.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/rectangleplot/init(_:xstart:xend:ystart:yend:)-4g377.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/rectangleplot/init(_:xstart:xend:ystart:yend:)-6d8yb.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/rectangleplot/init(_:xstart:xend:ystart:yend:)-6uuk4.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/rectangleplot/init(_:xstart:xend:ystart:yend:)-741lz.md)
- [init(_:xStart:xEnd:yStart:yEnd:)](charts/rectangleplot/init(_:xstart:xend:ystart:yend:)-ir9o.md)

### Supporting types

- [body](charts/chartcontent/body-swift.property.md)
- [VectorizedRectanglePlotContent](charts/vectorizedrectangleplotcontent.md)

## Relationships

### Conforms To

- [ChartContent](charts/chartcontent.md)
- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [VectorizedChartContent](charts/vectorizedchartcontent.md)

## See Also

### Vectorized plots

- [Creating a data visualization dashboard with Swift Charts](charts/creating-a-data-visualization-dashboard-with-swift-charts.md)
- [AreaPlot](charts/areaplot.md)
- [LinePlot](charts/lineplot.md)
- [PointPlot](charts/pointplot.md)
- [RulePlot](charts/ruleplot.md)
- [BarPlot](charts/barplot.md)
- [SectorPlot](charts/sectorplot.md)
- [VectorizedChartContent](charts/vectorizedchartcontent.md)
