Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

121
Views
Add a hoverable circle over a D3 chart plus tooltip

I'm trying to customize a D3 chart and I'm running into a few issues.

I want to add a circle that navigates the chart and shows a tooltip with data but none of the methods I've tried so far have worked. I've tried appending a circle and a tooltip in my code but they won't show up. This is exactly what I'm trying to achieve, but in my own code, it just doesn't work: https://bl.ocks.org/alandunning/cfb7dcd7951826b9eacd54f0647f48d3

I think this piece of code is the issue in my case and I don't know how to change it up or what to do about it:

    var focus = svg.append("g")
        .attr("class", "focus")
        .style("display", "none");

    focus.append("circle")
        .attr("r", 4.5);

    var rect = focus.append("rect")
        .attr("x", 9)
        .attr("dy", ".35em")
        .attr("fill", "yellow");

    var text = focus.append("text")
        var text = rect.append("text")
        .attr("x", 10)
        .attr("y", 10);

Here's a fiddle of my code: https://jsfiddle.net/3Lje1f4w/

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!