---
title: "init(x:y:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/linemark/init(x:y:)"
---

# init(x:y:)

Creates a line mark.

## Declaration

```swift
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 create a chart with a single line. Chart(sunshineData) {     LineMark(         x: .value("Month", $0.date),         y: .value("Hours of Sunshine", $0.hoursOfSunshine)     ) }

## See Also

### Creating a line mark

- [init(x:y:series:)](charts/linemark/init(x:y:series:).md)
