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

# init(x:y:series:)

Creates a separate line for each unique value of series.

## Declaration

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

## Parameters

- `x`: The value plotted with x.
- `y`: The value plotted with y.
- `series`: The value with which to split the line series by.

## Discussion

Discussion Use this initializer to create a multi-line chart from a single data source. Chart(sunshineData) {     LineMark(         x: .value("Month", $0.date),         y: .value("Hours of Sunshine", $0.hoursOfSunshine)     )     .foregroundStyle(by: .value("City", $0.city)) }

## See Also

### Creating a line mark

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