D3-tip

Tooltips for d3 visualizations

View the Project on GitHub Caged/d3-tip

d3.tip: Tooltips for d3.js visualizations

API Docs

Live Demo

API Documentation

Download Latest Version

Install with Bower

bower install d3-tip

Quick Usage

/* Initialize tooltip */
tip = d3.tip().html(function(d) { return d; });

/* Invoke the tip in the context of your visualization */
vis.call(tip)

vis.selectAll('rect')
  .data(data)
.enter().append('rect')
  .attr('width', function() { return x.rangeBand() })
  .attr('height', function(d) { return h - y(d) })
  .attr('y', function(d) { return y(d) })
  .attr('x', function(d, i) { return x(i) })
  /* Show and hide tip on mouse events */
  .on('mouseover', tip.show)
  .on('mouseout', tip.hide)