Toggling element visibility in v5
✓ Published0🌍 Public
Dd3noob
Last edited Nov 28, 2019
Created on Nov 28, 2019
This interactive line chart displays two time series from a CSV file, showing closing and opening values over dates. The visualization allows users to toggle the visibility of each line by clicking on its corresponding legend label. Built with D3.js v5, it uses `d3.line`, `d3.scaleTime`, and `d3.scaleLinear` to construct the SVG paths, while legend clicks dynamically adjust the `opacity` of each line group.
AI-generated descriptionThis is a multiple line graph demonstrating how to show / hide elements by clicking on other elements. This was written using d3.js v5 and is a follow on to the multiple line graph example here.
This graph is part of the code samples for the update to the book D3 Tips and Tricks to version 5 of d3.js.
mit Licensed