---
title: "opacity(_:)"
framework: charts
role: symbol
role_heading: Instance Method
path: "charts/vectorizedchartcontent/opacity(_:)"
---

# opacity(_:)

## Declaration

```swift
nonisolated func opacity(_ keyPath: KeyPath<Self.DataElement, CGFloat>) -> some VectorizedChartContent<Self.DataElement>

```

## Parameters

- `keyPath`: Points to a value between 0 (fully transparent) and 1 (fully opaque).

## See Also

### Styling marks

- [foregroundStyle(_:)](charts/vectorizedchartcontent/foregroundstyle(_:).md)
- [lineStyle(_:)](charts/vectorizedchartcontent/linestyle(_:).md)
- [position(by:axis:span:)](charts/vectorizedchartcontent/position(by:axis:span:).md)
