Skip to main content
100%

Dual axes in v6

✓ Published0🌍 Public
Dd3noob
Last edited Sep 12, 2020
Created on Sep 12, 2020

This example shows two time-series lines from a CSV file with date, close, and open values, each with its own colored y-axis: steelblue for the close values on the left and red for the open values on the right. The chart uses D3 v6’s `d3.scaleTime` and `d3.scaleLinear` for axes, `d3.line` to generate the SVG path data, and `d3.axisLeft` and `d3.axisRight` to render the separate scales. The data is loaded via `d3.csv` and parsed with `d3.timeParse` before being drawn as SVG paths within a single group element.

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 6 of d3.js.

gpl-3.0 Licensed

Similar vizzes