Skip to main content
100%

Fork of D3 Bar Chart Scales

✓ Published0🌍 Public
TTony Mai
Last edited Feb 27, 2026
Created on Feb 27, 2026

This example shows a two-scale bar chart using synthetic data, with band and linear scales mapping values to SVG rectangles. The D3 v4 code builds an SVG with bars shaded by value using `scaleBand` for the x-axis and `scaleLinear` for the y-axis, then appends text labels atop each bar. The chart animates when a paragraph is clicked, though no click handler is defined, so the visualization remains static. Data comes from an inline array.

AI-generated description
MIT Licensed

Similar vizzes