Skip to main content
100%

fresh block

✓ Published0🌍 Public
BBraMKJ
Last edited Mar 30, 2018
Created on Mar 30, 2018

This example shows a simple bar chart built from an array of five numeric values, rendered as blue rectangles with white strokes on an SVG canvas. The code uses D3 v4’s selection and data binding to map each data point to a rectangle, with the x-position determined by an index-based offset and the y-position calculated as the height minus the data value, so bars rise from the bottom. The chart’s fixed width per bar is set via a constant, while the height directly encodes each number. The data is hardcoded in the script, and the rendering relies on SVG’s native shape elements.

AI-generated description

Built with blockbuilder.org

mit Licensed

Similar vizzes