Stacked-to-Grouped d3 v4
✓ Published0🌍 Public
MMbrownshoes
Last edited Dec 10, 2016
Created on Dec 9, 2016
This interactive chart visualizes foreign investment data from the Government of British Columbia’s data catalogue, displaying the number of transactions across three categories over time. Users can toggle between stacked and grouped bar chart layouts via radio buttons, with each bar segment representing a different investment column. The visualization uses d3.v4’s scaleBand, scaleLinear, and stack functions for positioning and aggregation, while the data is fetched asynchronously via ajax from the catalogue’s API. SVG rectangles animate their height and y-position when switching modes, and a tooltip, built with d3.select, shows the precise value on mouseover.
AI-generated description- responsive
- tooltip
- ajax to fetch data
modified from http://blockbuilder.org/mbostock/3943967
mit Licensed