---
title: RulePlot
framework: charts
role: symbol
role_heading: Structure
path: charts/ruleplot
---

# RulePlot

Chart content that represents a collection of data using a single horizontal or vertical rule.

## Declaration

```swift
struct RulePlot<Content>
```

## Overview

Overview Use RulePlot when you want to visualize data in the same way as with RuleMark, 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 {     RulePlot(         tasks,         xStart: .value("Start time", \.startTime),         xEnd: .value("End time", \.endTime),         y: .value("Project", \.project)     )     .foregroundStyle(by: .value("Status", \.status))     .opacity(\.opacity)     .lineStyle(StrokeStyle(lineWidth: 8, lineCap: .round)) }

## Topics

### Plotting rules from a collection

- [init(_:x:yStart:yEnd:)](charts/ruleplot/init(_:x:ystart:yend:)-13wts.md)
- [init(_:x:yStart:yEnd:)](charts/ruleplot/init(_:x:ystart:yend:)-3fig9.md)
- [init(_:x:yStart:yEnd:)](charts/ruleplot/init(_:x:ystart:yend:)-6ts7e.md)
- [init(_:x:yStart:yEnd:)](charts/ruleplot/init(_:x:ystart:yend:)-8b2lx.md)
- [init(_:x:yStart:yEnd:)](charts/ruleplot/init(_:x:ystart:yend:)-zxo0.md)
- [init(_:xStart:xEnd:y:)](charts/ruleplot/init(_:xstart:xend:y:)-3dsvn.md)
- [init(_:xStart:xEnd:y:)](charts/ruleplot/init(_:xstart:xend:y:)-4yxo8.md)
- [init(_:xStart:xEnd:y:)](charts/ruleplot/init(_:xstart:xend:y:)-54gxx.md)
- [init(_:xStart:xEnd:y:)](charts/ruleplot/init(_:xstart:xend:y:)-8ehr7.md)
- [init(_:xStart:xEnd:y:)](charts/ruleplot/init(_:xstart:xend:y:)-hx5a.md)

### Supporting types

- [body](charts/chartcontent/body-swift.property.md)
- [VectorizedRulePlotContent](charts/vectorizedruleplotcontent.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)
- [RectanglePlot](charts/rectangleplot.md)
- [BarPlot](charts/barplot.md)
- [SectorPlot](charts/sectorplot.md)
- [VectorizedChartContent](charts/vectorizedchartcontent.md)
