Contents

init(xStart:xEnd:yStart:yEnd:)

Creates a bar mark with fixed x interval that plots values with its y interval.

Declaration

nonisolated init<Y>(xStart: CGFloat? = nil, xEnd: CGFloat? = nil, yStart: PlottableValue<Y>, yEnd: PlottableValue<Y>) where Y : Plottable

Parameters

  • xStart:

    The x start position. If xStart is nil then the rectangle will start at the leading edge of the plotting area.

  • xEnd:

    The x end position. If xStart is nil then the rectangle will end at the trailing edge of the plotting area.

  • yStart:

    The value plotted to y start.

  • yEnd:

    The value plotted to y end.

Discussion

Use this initializer to show vertical intervals for one category:

Chart(data) {
   BarMark(
       yStart: .value("Start Time", $0.start),
       yEnd: .value("End Time", $0.end)
   )
}

[Image]

See Also

Creating a bar mark