Skip to main content
100%

Let's build a bar chart - d3fc version

✓ Published0🌍 Public
CColinEberhardt
Last edited May 28, 2019
Created on Dec 4, 2016

This example recreates Mike Bostock’s classic bar chart using d3fc, showing letter frequencies from a tab-separated data file. The bars are colored by category, with vowels in indianred and consonants in steelblue, applied via the `decorate` pattern on `fc.seriesSvgBar`. Value labels appear above each bar using a custom `text` element added during decoration. The chart uses `fc.chartCartesian` with `d3.scaleBand` and `d3.scaleLinear`, while `fc.extentLinear` pads the y-domain and formats ticks as percentages. Data is loaded with `d3.tsv` and rendered as SVG.

AI-generated description

A re-implementation of Mike Bostock's classic "Let's Make a Bar Chart" example, using d3fc. This example highlights the power of the decorate pattern, with the bar colour changed on decorate, and value labels added.

mit Licensed

Similar vizzes