Canvas area charts zoom on click using d3.interpolateString
This example displays two time-series area charts—solar photovoltaic and building load power—rendered on an HTML5 Canvas using d3.area with a step curve, while SVG axes and a zoom button sit atop. Clicking the button toggles zoom between the full domain and a defined date range using d3.zoom and interpolated scale transitions via interpolateString. The hybrid approach combines Canvas for efficient drawing and SVG for interactive elements, with data loaded from a CSV file and scales updated to animate the view.
AI-generated descriptionBuilt with blockbuilder.org
forked from <a href='http://bl.ocks.org/interwebjill/'>interwebjill</a>'s block: <a href='http://bl.ocks.org/interwebjill/cc5361ca1d1c5538fab19999785c6d01'>Combining Canvas + SVG for Retina</a>
Zoom technique thanks to Andrew Reid: <a href='https://bl.ocks.org/Andrew-Reid/0d9a717117b4224b6abd3122717985a7'>Combining Canvas + SVG for Retina</a> and <a href='https://stackoverflow.com/questions/51014832/reversing-order-of-d3-zoom-scale-and-translate'>his thorough StackOverflow answer</a>
forked from <a href='http://bl.ocks.org/interwebjill/'>interwebjill</a>'s block: <a href='http://bl.ocks.org/interwebjill/55f1c93864afa661524fb7c63ddd2d70'>Canvas area charts zoom on click using d3.interpolateString</a>