Skip to main content
100%

D3 bar chart with scales & dataset

✓ Published0🌍 Public
CChaf1A
Last edited Nov 9, 2017
Created on Nov 9, 2017

This example demonstrates a simple bar chart created with D3.js version 4, where the height of each bar represents a numeric value from the included dataset. The visualization uses SVG rectangles positioned on a 200-by-500 canvas, with bars spaced evenly along the x-axis. The code applies D3's `selectAll` and `data` binding, along with the `enter` selection to create the rectangles, setting their `width`, `height`, `x`, and `y` attributes based on the data values. The bars are outlined with black strokes, and the dataset is provided as a CSV file.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/romsson/'>romsson</a>'s block: <a href='http://bl.ocks.org/romsson/f4baa95d363ee21d0952ca561cd2a0e5'>D3 bar chart without data-binding</a>

forked from <a href='http://bl.ocks.org/romsson/'>romsson</a>'s block: <a href='http://bl.ocks.org/romsson/194aa1ddc4735e82d7306dc69849db41'>D3 bar chart with scales & dataset</a>

mit Licensed

Similar vizzes