<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/LinePlot/init(x:y:t:domain:function:)-5c4bo",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Charts",
      "Charts"
    ],
    "preciseIdentifier" : "s:6Charts8LinePlotVA2A08FunctionbC7ContentVRszlE1x1y1t6domain8functionACyAEG7SwiftUI4TextV_A2NSNySdGSdAF_SdAGtSdYbctcfc"
  },
  "title" : "init(x:y:t:domain:function:)"
}
-->

# init(x:y:t:domain:function:)

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

```
nonisolated init(x: Text, y: Text, t: Text, domain: ClosedRange<Double>, function: @escaping @Sendable (Double) -> (x: Double, y: Double))
```

## Discussion

Parameters:

- x: The localized string key for the x label.
- y: The localized string key for the y label.
- t: The localized string key for the t label.
- domain: The domain of t. Must be a finite domain.
- function: The function to graph. Returns a tuple of (x, y) for a value of t.

> Note: For t values where the function is undefined or is infinity, the function is expected to return `Double.nan` or `Double.infinity` respectively.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)