Skip to main content
100%

D3 bar chart without data-binding

✓ Published0🌍 Public
RRade-Mathis
Last edited Nov 9, 2017
Created on Nov 9, 2017

This example displays a simple bar chart of ten numeric values, with each bar labeled by its corresponding data point. The chart is rendered entirely as SVG elements, and the bars react to mouseover events by turning yellow. The code uses D3 v4 to select the body element and append an SVG canvas, then applies a linear scale to map the data values to bar heights. Each rectangle and text label is created through D3's selection and append methods, with positions calculated from the array index.

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/anonymous/'>anonymous</a>'s block: <a href='http://bl.ocks.org/anonymous/bc7f0d98b37ba80324beac6ebfd0b5ca'>D3 bar chart without data-binding</a>

mit Licensed

Similar vizzes