<!--
{
  "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/value(atY:as:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift Charts"
    ],
    "preciseIdentifier" : "s:6Charts10ChartProxyV5value3atY2asxSg14CoreFoundation7CGFloatV_xmtAA9PlottableRzlF"
  },
  "title" : "value(atY:as:)"
}
-->

# value(atY:as:)

Returns the data value at the given y position, or `nil` if the position does not correspond to a valid Y value.

```
func value<P>(atY position: CGFloat, as: P.Type = P.self) -> P? where P : Plottable
```

## Parameters

`position`

The position at which to obtain the y data value. It should be relative to the plot.

## Return Value

The data value at the given position.

---

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)