Contents

init(x:y:domain:function:)

Creates a mark that graphs a function y = f(x).

Declaration

nonisolated init(x: LocalizedStringKey, y: LocalizedStringKey, domain: ClosedRange<Double>? = nil, function: @escaping  @Sendable (Double) -> Double)

Discussion

Parameters:

  • x: The x label.

  • y: The y label.

  • domain: The domain of x. If set to nil, the domain of the chart’s x scale will be used.

  • function: The function to graph.

See Also

Plotting functions