Skip to main content
100%

sync candlebar and line, 2-y-axis

✓ Published0🌍 Public
深深度碎片
Last edited Aug 7, 2016
Created on Aug 7, 2016

This example syncs a candlestick chart of stock price data with a line chart of returns, using two separate y-axes. The left axis shows price (Open, High, Low, Close) via red and green candles for up and down days, while the right axis displays a steelblue line for the return ratio. Built with D3 v4, it uses `d3.scaleTime`, `d3.scaleLinear`, `d3.line` with `d3.curveBasis`, and `d3.axisRight`/`d3.axisLeft`, rendering as SVG from a CSV file. The legend and axis labels clarify the dual metrics.

AI-generated description

Built with blockbuilder.org

forked from <a href='http://bl.ocks.org/EmbraceLife/'>EmbraceLife</a>'s block: <a href='http://bl.ocks.org/EmbraceLife/77a920a331c0ed20adfe2bba6f4b28aa'>candleBars</a>

forked from <a href='http://bl.ocks.org/EmbraceLife/'>EmbraceLife</a>'s block: <a href='http://bl.ocks.org/EmbraceLife/22dfe256e8d9400c2dc8c4a5e39da695'>2-y-axis, candlebar</a>

gpl-3.0 Licensed

Similar vizzes