Skip to main content
Public

Share visualization

Loading preview…

d3NoobV5 Reusable Examples - Bar Chart

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

d3NoobV5 Reusable Examples - Bar Chart

2
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:

Comments

Sign in to join the discussion.

MIT Licensed