How to avoid overlapped labels on a Scatterplot graph

427 views
Skip to first unread message

sspboyd

unread,
Oct 16, 2012, 1:04:16 PM10/16/12
to d3...@googlegroups.com
Here's the link to a demo version of my problem: http://jsfiddle.net/sspboyd/pe6xW/9/

Right now I have a scatterplot graph and I'm displaying text labels for nodes on mouseover. The problem I'm having is that the text labels are being obscured by other nodes being drawn overtop. 

How can I setup the rendering of the chart so that the nodes are drawn first, and then afterwards the text labels are drawn for nodes that are being moused over?

Thanks,
Stephen

Jamie Popkin

unread,
Oct 16, 2012, 5:09:22 PM10/16/12
to d3...@googlegroups.com
Hey Stephen.

Have you considered rendering the text in a separate group element <g> that is on top of the nodes?

Jamie

--
Jamie Popkin
Little Earth

Ian Johnson

unread,
Oct 17, 2012, 1:51:09 PM10/17/12
to d3...@googlegroups.com
you can move the highlighted node to the front:

i also made a short video illustrating the concept
--
Ian Johnson

Jamie Popkin

unread,
Oct 17, 2012, 3:15:24 PM10/17/12
to d3...@googlegroups.com
I don't mean to hijack this thread..... But.....
Ian - That site is so awesome I almost had a heart attack! Did you take part in creating enjalot?


--
Jamie Popkin
Little Earth



Ian Johnson

unread,
Oct 17, 2012, 3:19:07 PM10/17/12
to d3...@googlegroups.com
thanks Jamie :) yeah i've been working on the project called tributary with some friends. will be moving it to tributary.io soon (enjalot is my personal nickname)
i also made some more videoshttp://enjalot.github.com/dot-enter/ where i use the site to make d3 tutorials

Jamie Popkin

unread,
Oct 17, 2012, 3:55:35 PM10/17/12
to d3...@googlegroups.com
Fantastic project Ian. It will be great for people learning d3. Thanks for sharing. 

sspboyd

unread,
Oct 17, 2012, 5:18:12 PM10/17/12
to d3...@googlegroups.com
Thanks very much Ian. I've never received a custom screencast explaining a help request! Much appreciated.
And I with Jamie, that is a very cool site for demoing.

Krishna Moorthy

unread,
May 23, 2013, 12:51:37 AM5/23/13
to d3...@googlegroups.com
Hi Ian,

    i am working on rickshaw scatter plot graph.  is there any option for displaying the label above the scatter bubble in on load event. if yes . please let me know..
 
Reply all
Reply to author
Forward
0 new messages