Skip to main content
100%

Create a Bar Chart

✓ Published0🌍 Public
Aadamverdin
Last edited Sep 23, 2017
Created on Sep 23, 2017

This example shows a bar chart of language frequencies, with bars colored blue by default and highlighted in green for French and Italian. The chart is rendered as SVG using D3 v4, with an x-axis for language names and a y-axis for frequency percentages. The code loads tab-separated data from `languages.tsv` using `d3.tsv`, scales the data with `d3.scaleBand` and `d3.scaleLinear`, and draws rectangles via `g.selectAll(".bar").enter().append("rect")`. Hovering a bar turns it dark red, as defined by the `.bar:hover` CSS rule.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/jbelmont/'>jbelmont</a>'s block: <a href='http://bl.ocks.org/jbelmont/2886fb042412ded3e40bf5cf168413b6'>Create a Bar Chart</a>

mit Licensed

Similar vizzes