Line Chart 3D
Lines through a box, a point of the data after another.
The entries of data are points in space, joined in the order of the data:
a trajectory, a spiral, a walk. series names the field that tells the lines
apart. Pointing at a line lights the point nearest the pointer, with a dot
on it, and the tooltip reads that point. For entries along x with a value per series - the
line chart of a spreadsheet - see the area chart.
Installation
npx shadcn@latest add niekes/chart3dcn/line-chart-3d#v1.2.0Update
Press Update: the points glide to their new positions over the animationDuration
of the container, the line between them follows, and the axes scale along.
Enter and leave
With an id field, a point follows its name through updates: a new one
unfolds from the point before it on its line - from the one after it, at the
start - as it fades in, a gone one folds back into it - the mirror of its
entering - and one that moves glides (see Enter in the
glossary). So a
line grows at its end as the data gains a point, and shrinks from its start
as it loses one. Without an id, points are named by their position in
data, which animates appending and removing at the end. A line that is all
new stands in place and fades in. Data may come faster than the line glides,
as from a feed: every point goes on from where it is, a new one starting on
the point before it wherever that has come to.
Renderers
The same chart on every renderer, side by side. The marks are data the chart hands to the container, and "svg" and "canvas" draw them all - where the browser has no canvas, as SVG.
Many marks
The Lorenz attractor, three thousand points of it - and the chart stays
interactive. The scene is one list of marks, so the demo starts on
"canvas", the renderer for many marks, and the select shows the same scene
on SVG. colors names two config keys, and each point's part of the line
takes the color of its height on the ramp between them, in place of the
color of its series.
Gaps
An entry whose x, y or z is missing or not a number has no point, and
its line stops before it and starts again after it: no segment bridges a
value the data does not have. A point alone between two gaps is a circle as wide as the line.
API Reference
Prop
Type