Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom tooltip for nvd3
// custom tooltip example
chart.tooltip.contentGenerator(function (obj) {
var format = d3.format(",d");
return '<table><thead><tr><td class=x-value colspan=3><h1 class=tooltip>' + obj.data.name + '</h1></td></tr></thead>' +
'<tbody><tr><td class=key>Impact Factor:</td><td class=value>' + obj.data.meanIF + '</td></tr>' +
'<tr><td class=key>Citations:</td><td class=value>' + format(obj.data.meanCitations) + '</td></tr>' +
'<tr><td class=key>Funding:</td><td class=value>$' + format(obj.data.funding) + '</td></tr>' +
'</tbody></table>'
});
@Kyeongan

This comment has been minimized.

Copy link
Owner Author

@Kyeongan Kyeongan commented Jun 28, 2016

an example of custom tooltip
screen shot 2016-06-28 at 11 16 14 am

@nhdong1505

This comment has been minimized.

Copy link

@nhdong1505 nhdong1505 commented Mar 21, 2019

thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.