Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

A6 Diverging Bar Chart D3

Public visualization

Viewing a saved revision (read-only)

5eb6713da07c4af29b6f330869bbf62f

A6 Diverging Bar Chart D3

0 stars0🌍 Public
EEric Yao
Last edited Mar 5, 2024
Created on Mar 4, 2024
Forked from A5 Line Chart D3

This diverging bar chart visualizes the percentage-point change in smoking rates between 2011 and 2012 across five countries, with positive differences extending rightward in blue and negative differences leftward in red from a central zero axis. The chart uses D3.js v7 to load the CSV dataset, compute the absolute maximum difference for symmetric axis scaling, and render SVG rectangles with horizontal orientation. A d3-scale linear color scale maps negative to positive values through light grey, while the d3-legend plugin adds a horizontal color legend. Hovering highlights bars in orange, and the chart includes labeled axes for both percentage difference and country names.

AI-generated description

Used my old Bar Chart Visualization.

The csv file doesn't quite make sense as the percentage of total smokers should not be less than the percentage of both male and female smokers.