Skip to main content
100%

Zoomable Area Canvas with Retina

✓ Published0🌍 Public
TThanaporn-sk
Last edited Jun 18, 2019
Created on Jun 18, 2019

This example shows a zoomable area chart of power consumption data (TBLkW) recorded at hourly intervals from late December 2014 through early January 2015. The chart is rendered on a Canvas element using D3 v4’s `d3.area()` generator with a step curve, while axes and tick labels are drawn directly via the Canvas 2D context. A `d3.zoom()` behavior rescales the time scale on pan and zoom events, and the chart supports high-DPI displays by adjusting the canvas backing store ratio. The data is loaded from an external CSV file.

AI-generated description

forked from <a href='http://bl.ocks.org/interwebjill/'>interwebjill</a>'s block: <a href='http://bl.ocks.org/interwebjill/1df7087950353c7525cb6e8360276d32'>Zoomable Area SVG</a>

which was forked from <a href='http://bl.ocks.org/mbostock/'>mbostock</a>'s block: <a href='http://bl.ocks.org/mbostock/4015254'>Zoomable Area</a>

Zoom is not centered over the mouse cursor.

forked from <a href='http://bl.ocks.org/interwebjill/'>interwebjill</a>'s block: <a href='http://bl.ocks.org/interwebjill/206425109aa902c2928fa22b8a9f5fd8'>Zoomable Area Canvas with Retina</a>

forked from <a href='http://bl.ocks.org/lorenzopub/'>lorenzopub</a>'s block: <a href='http://bl.ocks.org/lorenzopub/cdaf8f4c7aace62c195013421329c372'>Zoomable Area Canvas with Retina</a>

gpl-3.0 Licensed

Similar vizzes