Is there a method to utilize the data-i18n
attribute with d3 tooltips?
In other words, is there a way to make it functional?
I currently have a tooltip:
var tip = d3.tip()
.attr("class", "tip")
.offset([-10,50])
.html(function(d) {
return "<span>" + d.amountCorrect + "/"
+ d.amountTaken
+ " ("
+ Math.floor((d.amountCorrect/d.amountTaken) * 100)
+ "%)</span>"
+ "<span data-i18n='markup.correct'></span>"
});
It is intended to display the percentage of correct answers. The last span is meant to display "solved correctly" in various languages.
However, it is not functioning correctly. The tooltip does not appear at all.
Upon changing the language, I can see the translation injected in the chrome inspector. Yet, once I hover over the bar, it is replaced with an empty span and becomes blank again.
How can I resolve this issue?
Thank you :)