Bar Chart 3D
Bars on a floor, one row per entry and one per series.
Stacks
Keys of the same name in stack stand on one another in one row along z, in
the order of keys - those above 0 upward from the floor, those below 0
downward from it - and the axis names the row by its stack. Here the browsers
stack as Web and the apps as App, so the depth still sets the two side by
side (ADR-0016).
A bar says its own value on hover; the tooltip of the demo adds the total
of its stack. A bar that comes grows where it stands in its stack and lifts
the bars over it.
One stack of every key leaves nothing on z: that is a 2D stacked bar chart,
and a 2D chart draws it better. For stacks of 100 %, normalise the data
first, with a map over the entries.
Installation
npx shadcn@latest add niekes/chart3dcn/bar-chart-3d#v1.2.0Update
Press Update: the chart glides into the new data over the animationDuration
of its container, and the y axis scales along.
Enter and leave
New data may also bring, drop and reorder whole rows - a bar follows the name
of its entry, in the index field. An added month grows out of the floor
and fades in while the row axis makes room, its line growing to the new
tick, its label fading in; a removed one shrinks back into the floor and
fades out, the mirror of its entering, while the rows around it glide to
their new cells and the axis closes the gap (see Enter in the
glossary).
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
Three hundred bars - 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.
API Reference
Prop
Type