Docs / Basics

Line chart

Free

Plot one or more series over a category axis. Supports smooth (spline) and stepped lines.

Illustration — rendered output uses live data.

Example

blade
<chart:line
    :series="[
        ['name' => 'Revenue', 'data' => [120, 180, 150, 260, 300]],
        ['name' => 'Cost', 'data' => [80, 110, 95, 140, 160]],
    ]"
    :categories="['Jan', 'Feb', 'Mar', 'Apr', 'May']"
    smooth
/>

Props

Prop Type Default Description
series array [] Series objects ([name, data]) or a flat list of numbers.
categories array [] Labels for the x-axis.
smooth bool false Render a smooth spline instead of straight segments.
step bool|string false Render a stepped line (start, middle or end).
stack bool|string false Stack series on top of each other.
legend bool true Show the series legend.

Plus the common props (height, theme, model, class).