Contents

init(x:yStart:yEnd:width:)

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

Declaration

nonisolated init<X, Y>(x: PlottableValue<X>, yStart: PlottableValue<Y>, yEnd: PlottableValue<Y>, width: MarkDimension = .automatic) where X : Plottable, Y : Plottable

Parameters

  • x:

    The value plotted with x.

  • yStart:

    The value plotted with y start.

  • yEnd:

    The value plotted with y end.

  • width:

    The bar width. If width is nil, the default bar size will be applied.

Discussion

Use this initializer to show vertical intervals for one or more categories:

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

[Image]

See Also

Creating a bar mark