---
title: "value(at:as:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/chartproxy/value(at:as:)"
---

# value(at:as:)

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

## Declaration

```swift
func value<X, Y>(at position: CGPoint, as: (X, Y).Type = (X, Y).self) -> (X, Y)? where X : Plottable, Y : Plottable
```

## Parameters

- `position`: The position at which to obtain the data values. It should be relative to the plot.

## Return Value

Return Value A tuple of the x and y data values at the given position.
