Skip to main content
100%

http://stackoverflow.com/questions/32057842/d3-js-highlighting-stacked-bar-and-getting-selected-values/32079517#32079517

✓ Published0🌍 Public
TThanaporn-sk
Last edited Mar 17, 2017
Created on Mar 17, 2017

This example shows a stacked bar chart of sales data for PC, SmartPhone, and Software product categories across five years, where users can interactively change the stacking offset method (wiggle, zero, expand, silhouette) and the layer ordering (inside-out, default, reverse) via dropdown menus. Built with D3.js (version 3.5.6), the visualization uses the `d3.layout.stack` API to compute stacked values and dynamically updates the y-axis scale and grid lines when selections change. The chart is rendered as SVG with animated transitions for the axis rescaling, and the code leverages custom helper libraries from a gist, including `d3.ui.select` for the controls and `d3.cbPlot` for axis creation.

AI-generated description

forked from <a href='http://bl.ocks.org/cool-Blue/'>cool-Blue</a>'s block: <a href='http://bl.ocks.org/cool-Blue/c2dcbd3e6be86be18fdd'>stacked bar chart with dynamic axes and labels</a>

mit Licensed

Similar vizzes