Contents

init(x:y:domain:function:)

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

Declaration

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

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