Skip to main content
100%

Diverging StackedBar Chart

✓ Published0🌍 Public
Aabrown004
Last edited May 31, 2018
Created on May 30, 2018

This example shows a diverging stacked bar chart built with D3 v3, displaying five labeled categories with numeric values. The chart renders as vertical bars with a color scale mapping each category to a distinct color from a predefined palette. It includes axes with a rotated y-axis label and a tooltip that appears on mouseover to show the category label and value. The code uses `d3.svg.axis`, `d3.scale.ordinal`, and `d3.scale.linear` to construct the visualization, with SVG rectangles for the bars and HTML divs for the tooltip. Data is hardcoded in the script, though commented-out code suggests it could also load from a CSV file.

AI-generated description

Built with blockbuilder.org

mit Licensed

Similar vizzes