Contents

init(x:y:)

Creates a line mark.

Declaration

nonisolated init<X, Y>(x: PlottableValue<X>, y: PlottableValue<Y>) where X : Plottable, Y : Plottable

Parameters

  • x:

    The value plotted with x.

  • y:

    The value plotted with y.

Discussion

Use this initializer to create a chart with a single line.

Chart(sunshineData) {
    LineMark(
        x: .value("Month", $0.date),
        y: .value("Hours of Sunshine", $0.hoursOfSunshine)
    )
}

[Image]

See Also

Creating a line mark