Sci*_*ear 3 javascript charts svg nan d3.js
I am using d3 to make a chart with multiple paths. I am displaying the path(s) description on the left hand side. The data & descriptions are dynamic so the size of the legend is naturally also dynamic, since it is not a big deal as long as I know the size of the text (just a minor adjustment to the domain/range). The problem is that I do not see an easy way to find the size of the text element in Firefox browsers.
Previously I was doing it with jquery's .width() but the clientWidth on the element is zero which seems to cause a NaNpx to be returned.
...
.on("click", function(){
    alert( $(this).width() ); // NaNpx
})
...
DEMO: Click on the words.
| 归档时间: | 
 | 
| 查看次数: | 1376 次 | 
| 最近记录: |