changing tooltip position on update

14 views
Skip to first unread message

ollie razdow

unread,
Jul 19, 2016, 9:37:10 PM7/19/16
to d3-js
Hello all

I am trying to make a live-updating bar chart with d3 and am having trouble with some of the features I would like to include.

I have added tooltips successfully, but would like the tooltip to update it's y position and displayed value as the rect that it is hovering over changes.

A fiddle is here:


The furthest I have been able to get is to add

d3.select('#tooltip').style('top', function(d){return parseFloat(d3.select('.temp').attr('y') )+ 'px';} )

to the update function, which was at least a result, but obviously is not returning a relevant piece of data.

Any help is much appreciated.

Thanks very much
Ollie 

Reply all
Reply to author
Forward
0 new messages