Created
June 27, 2013 15:02
-
-
Save yorzi/5877185 to your computer and use it in GitHub Desktop.
add simple tooltips for a line that's based on d3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svg.selectAll('.views_dot') | |
.data(data) | |
.enter() | |
.append('circle') | |
.attr("transform", "translate(10, 0)") | |
.attr('class', 'views_dot') | |
.attr('fill-opacity', 0) | |
.attr('cx', (d)-> | |
x( new Date(d.date) ) | |
) | |
.attr('cy', (d)-> y(d.value)) | |
.attr('fill', 'orange') | |
.attr('r', 5) | |
.attr('data-toggle', 'popover') | |
.attr('data-content', (d)=>"#{d.date}: #{@formatValue()(d.value)}") | |
# tooptip for d3 line chart | |
$('.views_dot').popover | |
title: '' | |
container : 'body' | |
html : true | |
trigger : 'hover' | |
placement : 'top' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment