Hi all, I am having trouble getting the correct output when I hover over the points. It’s supposed to show up something in the format of “year - name - time - doing allegation”, however, it’s showing up “undefined - undefined - undefined - undefined” instead. I wonder where the problem could be. Can anyone please help me identify the problem?
Thanks in advance!!!
Here’s the code chunk of the mouseover function:
.on('mouseover', (item) => {
tooltip.transition()
.style('visibility', 'visible')
if (item['Doping'] !== ""){
tooltip.text(item['Year'] + ' - ' + item['Name'] + ' - ' + item['Time'] + ' - ' + item['Doping'])
} else {
tooltip.text(item['Year'] + ' - ' + item['Name'] + ' - ' + item['Time'] + ' - ' + 'No Allegations')
}
})
.on('mouseout', (item) => {
tooltip.transition()
.style('visibility', 'hidden')
})
I couldn’t find any problem with the code chunk itself. It might be issues relating to other parts of my code.
My complete code (incl. HTML & CSS) can be found on my GitHub
Any help is greatly appreciated!!! - Chris