Skip to main content
100%

d3NoobV5 Reusable Examples - Bar Chart

✓ Published2🌍 Public
JJimMaltby
Last edited Sep 1, 2021
Created on Jun 7, 2021

A reusable bar chart built with D3 v5 renders sales data from a CSV file, displaying a categorical x-axis of salesperson names and a linear y-axis for sales values. The chart uses `d3.scaleBand` and `d3.scaleLinear` for positioning, with `d3.axisBottom` and `d3.axisLeft` for axes, and draws bars as SVG `rect` elements. The code follows a modular pattern based on Mike Bostock’s reusable charts approach.

AI-generated description

Simple Bar Chart:

A vanilla HTML implementation of reusable version of d3Noob's V5 examples.

Examples Malcolm Maclean's (d3noob) great book "D3 Tips and Tricks v5.x Interactive Data Visualization in a Web Browser" (https://leanpub.com/d3-t-and-t-v5).

The reusable template is derived from Mike Bostock's Towards Reusable Charts (https://bost.ocks.org/mike/chart/) as the source of the foundational principles. But uses the ProD3 pattern (Pro D3.js Use D3.js to Create Maintainable, Modular, and Testable Charts by Marcos Iglesias https://www.apress.com/gp/book/9781484252024) as the basis for the charts.

Addtional help from and aknowledgement to:

MIT Licensed

Similar vizzes