<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "tvOS: 17.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/ChartProxy/plotContainerFrame",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "Swift Charts",
      "Charts"
    ],
    "preciseIdentifier" : "s:6Charts10ChartProxyV18plotContainerFrame7SwiftUI6AnchorVySo6CGRectVGSgvp"
  },
  "title" : "plotContainerFrame"
}
-->

# plotContainerFrame

An anchor to the frame of the chart’s plot container, or `nil` if there is no chart in the context of the chart
proxy.

```
var plotContainerFrame: Anchor<CGRect>? { get }
```

## Discussion

The plot is the area between the x and y axes, not including the axes themselves. If the chart is scrollable,
the plot container frame only includes the visible portion of the plot. Otherwise, it is the same as
[`plotFrame`](/documentation/Charts/ChartProxy/plotFrame).

You can convert the anchor to a frame using a `GeometryProxy`. Below is an example adding a border to the plot
container:

```
Chart { ... }
.chartOverlay { chartProxy in
    GeometryReader { geometryProxy in
        // Get the plot container's frame in the GeometryReader's coordinate space.
        // This frame stays the same when the chart scrolls.
        // In this example, we add a border to the plot container by stroking the frame.
        if let plotContainerFrame = chartProxy.plotContainerFrame {
            Path(geometryProxy[plotContainerFrame])
                .stroke(.black, lineWidth: 1)
                .allowsHitTesting(false)
        }
    }
}
```

---

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)