Skip to main content
100%

Gist d66394e7abd5ee805eeb82284db3106f

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

This example combines d3.brush and d3.zoom to implement Focus + Context navigation for a stock price dataset. The main panel displays daily candlestick bars (open, high, low, close) and an area chart of cumulative returns, while a smaller context panel shows the full price range. Dragging the brush in the context panel updates the focus domain, and panning or zooming in the focus area conversely adjusts the brush. The code uses d3.area, d3.axisBottom, and d3.axisLeft, with data loaded from a CSV file.

AI-generated description

Combining d3-brush and d3-zoom to implement Focus + Context. Another approach is to zoom to the brushed region.

forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/34f08d5e11952a80609169b7917d4172'>Brush & Zoom</a>

forked from <a href='http://bl.ocks.org/EmbraceLife/'>EmbraceLife</a>'s block: <a href='http://bl.ocks.org/EmbraceLife/7efd1f9031beecb5252e57e944e1a440'>Brush & Zoom</a>

gpl-3.0 Licensed

Similar vizzes