So I have the code to show an image on mouseover, as seen below. But at the moment, the image is appearing below the text and interfering with other elements on the page. I want to make the image appear diagonally to the right and above of the text. Is there a way to do this in d3.js?
d3.select('#uv')
.on('mouseover', function onClick(d) {
d3.select(this)
.append('img')
.attr("id", "img")
.attr('src', "UV_Index.jpg")
.attr("width", 400)
.attr("height", 200)
})
Here is an image of what it shows now:
It doesn't even have to move position. But just not be covered by the line chart. I just want it to cover it, or move position away from the line chart.
Thanks in advance, and let me know if you need more info about my code.