Skip to main content
100%

Labels on multiple lines v5

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

Two time series lines show daily open and close stock prices from a CSV file, with each line labeled at its final value on the right edge of the chart. The graph uses d3.line to generate the paths, d3.scaleTime and d3.scaleLinear for the axes, and d3.axisBottom and d3.axisLeft to render them. Text labels for “Open” and “Close” are placed manually via SVG text elements, positioned using the y-scale at the last data point. The example is built with D3 v5 and renders to SVG.

AI-generated description

This is a multiple line graph demonstrating the display of labels for each line. This was written using d3.js v5 and is a follow on to the multiple line graph example here.

This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 5 of d3.js.

mit Licensed

Similar vizzes