RulePlot
Chart content that represents a collection of data using a single horizontal or vertical rule.
Declaration
struct RulePlot<Content>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:)init(_:x:yStart:yEnd:)init(_:x:yStart:yEnd:)init(_:x:yStart:yEnd:)init(_:x:yStart:yEnd:)init(_:xStart:xEnd:y:)init(_:xStart:xEnd:y:)init(_:xStart:xEnd:y:)init(_:xStart:xEnd:y:)init(_:xStart:xEnd:y:)