I got a angular directive that displays a plottable line graph. But I need to set tooltips whit the value when the cursor hovers the line im plotting.
I got something like this:
var plot = new Plottable.Plots.Line()
.addDataset(ds)
.x(project_x, xScale)
.y(project_y, yScale)
.attr('stroke', function(d) { return label; }, colorScale);
and renders with
var svgElem = elem.find('svg')[0];
plot.renderTo(svgElem);
That works greate :) and then I tries to add some tooltips from this example: http://jsfiddle.net/gv1xsnkr/
// Initializing tooltip anchor
var tooltipAnchorSelection = plot.foreground().append("circle").attr({
r: 3,
opacity: 0
});
In the example they are using jquery, I dont want to import jquery just for this
var tooltipAnchor = $(tooltipAnchorSelection.node());
tooltipAnchor.tooltip({
animation: false,
container: "body",
placement: "auto",
title: "text",
trigger: "manual"
});
So I tries to do it like this
var tooltipAnchor = document.querySelectorAll(tooltipAnchorSelection.node().nodeName);
But I get an error on
tooltipAnchor.tooltip({ ... });
angular.js:14516 TypeError: tooltipAnchor.tooltip is not a function
Anyone got a clue hot to do this?