Skip to main content
100%

d3.js tool tips with links in data

✓ Published0🌍 Public
Dd3noob
Last edited May 1, 2014
Created on May 1, 2014

This example shows a line chart of stock closing prices that, when hovering over a point, displays a tooltip containing the date, the price, and a hyperlink to a related resource stored in the CSV data. The tooltip appears with a fade-in effect and includes an HTML anchor tag that opens the link in a new tab. Built with D3 v3, the code uses `d3.csv` to load the data, `d3.time.scale` and `d3.svg.line` for the chart, and SVG circles with mouseover events to trigger the tooltip, which is a styled `div` positioned at the cursor.

AI-generated description

This is designed to demonstrate generating tool tips with an HTML linkwith links contained in the source csv file. The graph is based on a simple line graph per the book D3 Tips and Tricks and was generated in response to a question on the d3noob.org blog.

It is also a follow on from a slightly simpler version here.

Similar vizzes