Contents

init(xStart:xEnd:y:height:)

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

Declaration

nonisolated init<X, Y>(xStart: PlottableValue<X>, xEnd: PlottableValue<X>, y: PlottableValue<Y>, height: MarkDimension = .automatic) where X : Plottable, Y : Plottable

Parameters

  • xStart:

    The value plotted with x start.

  • xEnd:

    The value plotted with x end.

  • y:

    The value plotted with y.

  • height:

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

Discussion

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

Chart(data) {
   BarMark(
       xStart: .value("Start Time", $0.start),
       xEnd: .value("End Time", $0.end),
       y: .value("Job", $0.job)
   )
}

[Image]

See Also

Creating a bar mark