Skip to main content
100%

STACKBAR Group Colours

✓ Published0🌍 Public
JJimMaltby
Last edited Dec 3, 2020
Created on Dec 3, 2020

This stacked bar chart visualizes the distribution of four numeric values (A–D) across eight animal species, with each bar’s segments colored by the animal’s group (Domestic, Pest, Africa, or Marine) rather than by the series itself. The animation on load slides the bars into place from the right, with each segment transitioning in width and position. Built with D3.js v5 and rendering SVG, it uses `d3.stack()`, `d3.scaleBand()`, `d3.scaleLinear()`, and `d3.scaleOrdinal()` to map data from a CSV file, while each group receives its own color palette defined through a custom ordinal scale.

AI-generated description

Simplified Stack bar for colouring bars by different groups http://bl.ocks.org/JimMaltby/844ca313589e488b249b86ead0d621a9

MIT Licensed

Similar vizzes