---
title: ChartProxy
framework: charts
role: symbol
role_heading: Structure
path: charts/chartproxy
---

# ChartProxy

A proxy that you use to access the scales and plot area of a chart.

## Declaration

```swift
struct ChartProxy
```

## Overview

Overview You get a chart proxy from the chartOverlay(alignment:content:) and chartBackground(alignment:content:) modifiers. You can use the chart proxy to convert data values to screen coordinates or vice-versa. Below is an example where we convert the screen coordinates from a drag gesture to data values. Chart(data) {     LineMark(         x: .value("date", $0.date),         y: .value("price", $0.price)     ) } .chartOverlay { proxy in     GeometryReader { geometry in         Rectangle().fill(.clear).contentShape(Rectangle())             .gesture(                 DragGesture()                     .onChanged { value in                         // Convert the gesture location to the coordinate space of the plot area.                         let origin = geometry[proxy.plotAreaFrame].origin                         let location = CGPoint(                             x: value.location.x - origin.x,                             y: value.location.y - origin.y                         )                         // Get the x (date) and y (price) value from the location.                         let (date, price) = proxy.value(at: location, as: (Date, Double).self)                         print("Location: \(date), \(price)")                     }             )     } }

## Topics

### Instance Properties

- [plotAreaFrame](charts/chartproxy/plotareaframe.md)
- [plotAreaSize](charts/chartproxy/plotareasize.md)
- [plotContainerFrame](charts/chartproxy/plotcontainerframe.md)
- [plotFrame](charts/chartproxy/plotframe.md)
- [plotSize](charts/chartproxy/plotsize.md)

### Instance Methods

- [angle(at:)](charts/chartproxy/angle(at:).md)
- [foregroundStyle(for:)](charts/chartproxy/foregroundstyle(for:).md)
- [foregroundStyleDomain(dataType:)](charts/chartproxy/foregroundstyledomain(datatype:).md)
- [lineStyle(for:)](charts/chartproxy/linestyle(for:).md)
- [lineStyleDomain(dataType:)](charts/chartproxy/linestyledomain(datatype:).md)
- [position(for:)](charts/chartproxy/position(for:).md)
- [position(forX:)](charts/chartproxy/position(forx:).md)
- [position(forY:)](charts/chartproxy/position(fory:).md)
- [positionRange(for:)](charts/chartproxy/positionrange(for:).md)
- [positionRange(forX:)](charts/chartproxy/positionrange(forx:).md)
- [positionRange(forY:)](charts/chartproxy/positionrange(fory:).md)
- [selectAngleValue(at:)](charts/chartproxy/selectanglevalue(at:).md)
- [selectXRange(from:to:)](charts/chartproxy/selectxrange(from:to:).md)
- [selectXValue(at:)](charts/chartproxy/selectxvalue(at:).md)
- [selectYRange(from:to:)](charts/chartproxy/selectyrange(from:to:).md)
- [selectYValue(at:)](charts/chartproxy/selectyvalue(at:).md)
- [symbol(for:)](charts/chartproxy/symbol(for:).md)
- [symbolDomain(dataType:)](charts/chartproxy/symboldomain(datatype:).md)
- [symbolSize(for:)](charts/chartproxy/symbolsize(for:).md)
- [symbolSizeDomain(dataType:)](charts/chartproxy/symbolsizedomain(datatype:).md)
- [value(at:as:)](charts/chartproxy/value(at:as:).md)
- [value(atAngle:as:)](charts/chartproxy/value(atangle:as:).md)
- [value(atX:as:)](charts/chartproxy/value(atx:as:).md)
- [value(atY:as:)](charts/chartproxy/value(aty:as:).md)
- [xDomain(dataType:)](charts/chartproxy/xdomain(datatype:).md)
- [yDomain(dataType:)](charts/chartproxy/ydomain(datatype:).md)

## See Also

### Chart management

- [ChartPlotContent](charts/chartplotcontent.md)
