Skip to content

Line

A line is the right default for a continuous numeric trend over time (or any naturally ordered x). Multiple series share the same axes via stroke.

```plot view=daily_signups
Plot.line(data, { x: "date", y: "count" })
```
```plot view=daily_signups_by_source
Plot.line(data, { x: "date", y: "count", stroke: "source" })
```
```plot view=daily_signups
{
marks: [
Plot.line(data, { x: "date", y: "count" }),
Plot.dot(data, { x: "date", y: "count", r: 3 }),
Plot.tip(data, Plot.pointer({ x: "date", y: "count" })),
]
}
```
OptionMeaning
x, ycolumn names (x is usually a date or ordered numeric)
strokecolumn name → series color
strokeWidthline thickness in px
strokeDasharraye.g. "4 2" for dashed lines
curve"linear" (default), "monotone-x", "step", "basis", "natural"
markertrue or "circle", "arrow", etc. for per-point markers
zcolumn name → grouping (use when stroke isn’t set)
tiptrue for hover tooltips

See Observable Plot — line for the full reference.