Skip to main content
Public

Share visualization

Loading preview…

d3NoobV5 Reusable Examples - MultiLine 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 - MultiLine Chart

2
JJimMaltby
Last edited Jun 7, 2021
Created on Jun 7, 2021

A reusable multi-line chart renders two time-series lines from a CSV dataset, plotting date against closing and opening values. The visualization demonstrates a modular chart architecture using D3 v5's SVG rendering, with scales, axes, and gridlines constructed via `d3.scaleTime`, `d3.scaleLinear`, `d3.axisBottom`, and `d3.axisLeft` within a pattern inspired by Mike Bostock's reusable charts. The chart draws two distinct lines from the same data columns, showing how additional series can be added to the reusable component.

AI-generated description

Simple Line Chart with Grid Lines:

A vanilla HTML implementation of a 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).

It 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