<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/ChartProxy/position(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift Charts"
    ],
    "preciseIdentifier" : "s:6Charts10ChartProxyV8position3forSo7CGPointVSgx1x_q_1yt_tAA9PlottableRzAaKR_r0_lF"
  },
  "title" : "position(for:)"
}
-->

# position(for:)

Returns the x and y positions as a `CGPoint` for the given data values, or `nil` if either the X or the y scale
is unavailable or if any data value is invalid. The returned position is relative to the plot.

```
func position<X, Y>(for point: (x: X, y: Y)) -> CGPoint? where X : Plottable, Y : Plottable
```

## Parameters

`point`

A tuple of x and y data values.

## Return Value

The position corresponding to the data values.

---

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)