Skip to main content
100%

Multi-Line and Difference Area Chart

✓ Published0🌍 Public
663anp3ca
Last edited Nov 1, 2018
Created on Oct 10, 2018

This example demonstrates a dual-mode chart that switches between a multi-line comparison and a difference area view, with a toggle control. The multi-line mode overlays two series as linear curves, while the difference mode fills the area between them, coloring increases and decreases distinctly. Hovering triggers a Voronoi overlay to identify the nearest data point and display its y-value. Built with D3 v4, the chart uses SVG for rendering, `d3.area` for the difference path, `d3.scalePoint` for the toggle, and animated transitions via `transition.attrTween` to smoothly update axes and shapes.

AI-generated description

This two series chart toggles between a multi-line chart and a difference area chart. When mouseing over the chart, the closest data point will display it's y-axis measurement.

forked from <a href='http://bl.ocks.org/TommyCoin80/'>TommyCoin80</a>'s block: <a href='http://bl.ocks.org/TommyCoin80/ee23cb1461d04d020d1458c9400861d7'>Multi-Line and Difference Area Chart</a>

mit Licensed

Similar vizzes