Skip to main content
100%

Multi-line graph 3 with v5: Legend

✓ Published0🌍 Public
Dd3noob
Last edited Nov 28, 2019
Created on Nov 28, 2019

This interactive multi-line chart displays monthly stock prices for Microsoft, Amazon, and IBM from January 2000 to March 2010, with each series distinguished by a color from the Category 10 palette. Built with d3.v5, it renders lines as SVG paths and includes a legend beneath the plot, where each company name is color-coded to match its line. The dataset, sourced from Mike Bostock’s small multiples example, is grouped by symbol using d3.nest(), with scales defined by d3.scaleTime and d3.scaleLinear for the axes.

AI-generated description

This is a derivative of the simple d3.js graph in v5 used as an example in the book D3 Tips and Tricks v5. The stock data was sourced from Mike Bostock's small multiples example.

It is the third graph in a series that is building a multi-line graph that incorperates an automatically developed legend and a system that can toggle the lines off and on as desired.

This version is demonstrating the addition of a legend to the graph.

The graph should be taken in context with the text of the book which can be downloaded for free from Leanpub.

mit Licensed

Similar vizzes