Skip to main content
100%

Dual axes in v7

✓ Published0🌍 Public
Dd3noob
Last edited Jun 19, 2021
Created on Jun 19, 2021

This example displays two line charts sharing a common time axis, with each line assigned its own colored vertical scale: a steelblue line for the "close" values on the left axis and a red line for the "open" values on the right axis. It uses the d3.v7 library, specifically the `d3.line` generator, `d3.scaleTime`, and two `d3.scaleLinear` scales. Data is loaded from a local CSV file via `d3.csv`, with dates parsed using `d3.timeParse`. The SVG output renders the paths and axes with custom CSS classes for axis-label coloring.

AI-generated description

This is a multiple line graph demonstrating the display of seperate colour coded y axes for each line.

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

gpl-3.0 Licensed

Similar vizzes