Viewing a saved revision (read-only)
d1c297b04a4549d095c0b52801bc4cc0
STACKBAR Group Colours
A stacked horizontal bar chart displays animal data across four value columns, with each bar segment colored according to the animal's group membership (Domestic, Pest, Africa, Marine). Built with D3 v5, the visualization uses `d3.stack()` and `d3.scaleOrdinal` to map group colors, with `d3.scaleBand` for the categorical axis and `d3.scaleLinear` for values. The chart includes mouseover tooltips showing animal and group, hover highlighting via CSS, and dropdown controls for group selection. Data loads from CSV using `d3.csv` with automatic type conversion and total column calculation.
AI-generated descriptionSimplified Stack bar for colouring bars by different groups and adding Animations and Tooltips http://bl.ocks.org/JimMaltby/844ca313589e488b249b86ead0d621a9