The purpose of this snippet is to open a popup with a chart when a word is clicked. The chart is still not included into the popover, but I'm going one step at a time.
var childText = svg.selectAll("childText")
.data(...)
.enter().append("text")
.attr("class", "btn btn-lg btn-danger")
.attr("x", "...")
.attr("y", "...")
.attr("font-size", "...")
.attr("fill", "...")
.attr("role", "button")
.attr("data-content", "it works!")
.attr("data-trigger", "focus")
.attr("data-toggle", "popover")
.attr("title", "graph")
.attr("data-content", "yi boi")
.attr("tabindex", "0")
.text("...")
$(document).ready(function () {
$('[data-trigger="focus"]').popover({'show':true});
});
The HTML works without throwing any error but when I click the word, nothing happens. I notice a specific attribute (aria-describedby="popover900071") is generated inside the element as I click on the word. That's the only change happening, no popover nor errors appear.
Versions used:
Bootstrap: 3.3.7
d3: 3.5.0
(other libraries used) c3: 0.4.11, jQuery: 3.1.1
Bootstrap popover documentation: http://getbootstrap.com/javascript/#popovers
TL;DR: Trying to use popover from Bootstrap in d3 application, popover not appearing and no errors generated.