Use dateGenerator() in timestampToDate() instead of Date()
This ensures the flot.options.timezone is used
NB: This relies on a patch to jquery.flot.time.js to expose the
dateGenerator() function.
Prevent tooltip from disappearing off RHS of screen
Change the tooltip not to wrap, and watch for it being too close to RHS.
If it is then move it back by twice the width (as the window has already
gotten wider to accommodate the tooltip being there), causing the
tooltip to now be on the LHS of the cursor.
fix tooltip position

When approaching the lower end of the container also appears bug in a tooltip.

Changing the position of a tooltips is better to apply after filling the contents and change its size. In addition, we do not need the extra steps to determine the position when a tooltip is hidden. Otherwise, we can observe twitching a tooltips.
Properly fix tooltip x/y with respect to current viewport
NB: This is still somewhat of a heuristic.
What I'd like to do is something like:

var totalTipWidth = $("#flotTip").width() + this.tooltipOptions.shifts.x + $("#flotTip").css('padding-left') + $("#flotTip").css('padding-right') + $("#flotTip").css('border-left-width') + $("#flotTip").css('border-right-width');

But the .css() properties don't seem to be set at this point (they
return NaN).  So instead there's the heuristic of using multiples of the
shifts.x/y instead.