<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/PointMark/init(x:y:)-44ke9",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Charts"
    ],
    "preciseIdentifier" : "s:6Charts9PointMarkV1x1yAcA14PlottableValueVyxG_AGyq_GtcAA0D0RzAaJR_r0_lufc"
  },
  "title" : "init(x:y:)"
}
-->

# init(x:y:)

Creates a point mark that plots values to x and y.

```
nonisolated init<X, Y>(x: PlottableValue<X>, y: PlottableValue<Y>) where X : Plottable, Y : Plottable
```

## Parameters

`x`

The value plotted with x.

`y`

The value plotted with y.

## Discussion

### Discussion

Use this initializer to plot one property with x and another property with y:

```swift
Chart(data) {
    PointMark(
        x: .value("Wing Length", $0.wingLength),
        y: .value("Wing Length", $0.wingWidth)
    )
}
```

![A scatter plot with wing width plotted on the x-axis and wing height plotted on the y-axis. There are 12 points on the chart that demonstrate a roughly linear relationship between wing width and height.](images/com.apple.Charts/PointMarkSwift.PointMarkScatterChart@2x.png)

For more background, see the first example used in [`PointMark`](/documentation/Charts/PointMark) which shows the structure that contains the `wingLength` and
`wingHeight` properties.

---

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)