Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

STACKBAR Group Colours

Public visualization

Viewing a saved revision (read-only)

df898eac77554f9a919c540f371e816e

STACKBAR Group Colours

0 stars0🌍 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