---
title: "value(atY:as:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/chartproxy/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.

## Declaration

```swift
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

Return Value The data value at the given position.
