Skip to main content
100%

Diverging Color Scale

✓ Published0🌍 Public
KKwasi Acquaye
Last edited Mar 4, 2024
Created on Mar 4, 2024

This diverging bar chart displays positive and negative values for seven categories using a diverging color scale. The visualization encodes value magnitude through bar height, while direction is shown by bars extending above or below a central zero axis, with the PiYG interpolator assigning distinct colors to positive and negative values. Built with D3 v6, the example uses `scaleDiverging`, `scaleBand`, and `scaleLinear` to position and color rectangles, alongside the d3-legend library to render a horizontal color legend. Data comes from a local CSV file containing category-value pairs.

AI-generated description
MIT Licensed

Similar vizzes