gwatts / jquery.sparkline

A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser
http://omnipotent.net/jquery.sparkline/
1.24k stars 278 forks source link

Tooltips on window right edge are partly not visible, and trigger horizontal scroll #117

Open nturcot opened 10 years ago

nturcot commented 10 years ago

When a sparkline is located close to the right edge of the window (or any scrollable element), any tooltip close to this edge is partly hidden and triggers the horizontal scrollbar.

Demo: http://jsfiddle.net/M7kXc/1/ - to reproduce, move your mouse over the graph from left to right. When approaching the right edge, the tooltip should stop moving, but too late: it is half hidden and scrollbar appeared. Reproduced on Firefox 28 and Chrome 35.

tooltipscroll

timvasil commented 10 years ago

I was able to fix the issue by changing width() to outerWidth() and height() to outerHeight() in the Tooltip's getSize() method. In v2.1.2, this is around line 870 of the unminified source.

thinkjson commented 8 years ago

Is there a pull request for this yet?