Skip to main content
100%

d3fc dual axes example

✓ Published0🌍 Public
CColinEberhardt
Last edited Dec 6, 2016
Created on Dec 6, 2016

This example demonstrates how d3fc can be used to create a chart with dual y-axes, plotting both the opening and closing stock prices from a CSV file as two separate line series. The close price line is rendered in red and paired with a left axis, while the open price line uses a right axis, with each series having its own independent linear scale. The chart layout is built from HTML elements and flexbox, with d3fc-svg components handling the plot area and axes, and d3fc-group managing responsive redraws. The code uses d3.scaleTime for the x-axis and d3fc's axisBottom, axisRight, and axisLeft for the axes, along with seriesSvgLine for the line series.

AI-generated description

Similar vizzes