---
title: "positionRange(forY:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/chartproxy/positionrange(fory:)"
---

# positionRange(forY:)

Returns the range of y position for the given data value, or nil if the x scale is unavailable or if the value is invalid. The returned position range is relative to the plot.

## Declaration

```swift
func positionRange<P>(forY value: P) -> ClosedRange<CGFloat>? where P : Plottable
```

## Parameters

- `value`: The data value.

## Return Value

Return Value The position range corresponding to the data value.

## Discussion

Discussion For a continuous data value, the returned range is a single point. For a categorical data value, the returned range is the range of positions that correspond to the given category.
