Skip to main content
100%

Multi-line graph 2: Colours

✓ Published0🌍 Public
Dd3noob
Last edited Nov 30, 2019
Created on Jul 5, 2014

This multi-line graph displays stock price changes over time for Microsoft, Amazon, and IBM, with each line distinguished by a unique color. The visualization uses the D3.js library (version 3.5) to parse CSV data, scale time and price ranges, and render SVG paths. It applies a categorical color scale via `d3.scale.category10` and assigns colors dynamically to each symbol group from the nested data. The example focuses solely on demonstrating color differentiation among multiple lines, without legends or interactive toggling.

AI-generated description

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

It is the second 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 application of unique colours to the graph lines.

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