Search code examples
d3.jstooltip

d3 Object [object Array] has no method 'tranisition'


 if (!d3.selectAll(".tooltip")[0].length) {
     var tooltip = d3.select("body").append("div")
            .attr("class", "tooltip")
            .style("opacity", 0);
 }

function mouseover(d) {
            tooltip.tranisition()
            .duration(300)
            .style("opacity", 1);
}

If I change it to tooltip[0][0] it say HTMLDivElement has no method transition. Wondering why it doesn't like this...


Solution

  • You've misspelt transition -- should be

    tooltip.transition()