@activitystream/d3-tip 中文文档教程
d3.tip: Tooltips for d3.js visualizations
API Docs
请参阅 API 文档
Download Latest Version
- Development Version : 6kb / ~2kb gzipped
Install with Bower
bower install d3-tip
Quick Usage
/* Initialize tooltip */
tip = d3.tip().attr('class', '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) })
.on('mouseover', tip.show)
.on('mouseout', tip.hide)
如果您需要基本样式,可以包含 example-styles .css
使用类似的服务 原始github.com。
<link rel="stylesheet" href="//rawgithub.com/Caged/d3-tip/master/examples/example-styles.css">
d3.tip: Tooltips for d3.js visualizations
API Docs
See the API Documentation
Download Latest Version
- Development Version : 6kb / ~2kb gzipped
Install with Bower
bower install d3-tip
Quick Usage
/* Initialize tooltip */
tip = d3.tip().attr('class', '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) })
.on('mouseover', tip.show)
.on('mouseout', tip.hide)
If you want basic styling, you can include example-styles.css
using a service like rawgithub.com.
<link rel="stylesheet" href="//rawgithub.com/Caged/d3-tip/master/examples/example-styles.css">
更多