Thus, prevent it from becoming topmost (it may cause strange looks if
original series is not topmost: some part of it becomes topmost and
overwrites some lines and points that should be above it instead).
Use bind, rather than .mouseleave, because we officially still support
jQuery 1.2.6, which doesn't define a shortcut for mouseenter or
mouseleave. This was a bug/oversight that was fixed somewhere around
1.3.x. We can return to using .mouseleave when we drop support for
1.2.6.
Rounding errors are introduced when calculating the percentage when the total is 100 (for example if percentages have already been calculated). Calculating (total/100) first eliminates the error in this case.
When the placeholder has (or inherits) the HTML 'dir' attribute or CSS
'direction' we get unexpected results from text metrics, resulting in
visual glitches on the axes.
The suggested solution in #716 was to set ltr on the placeholder, but
this introduces its own problems, since the user probably *does* expect
rtl on items like the legend. So we'll instead set ltr only on the
canvases.
We should review this behavior at some point; rtl is something we need
to handle, not work around. It also needs to be kept in mind as we move
canvas-text into a plugin. But for now this solution at least ensures
consistent behavior.
When a pie's labels don't fit within its container, the pie is redrawn
with a smaller radius until the labels fit, or a fixed number of retry
attempts are exhausted. The redraw flag was not reset on success,
however, which prevented the pie from being redrawn again after a resize
or update.
The primary canvas uses position: absolute while the overlay canvas does
not. This can cause the two to get out of alignment in rare cases when
floating elements are placed near the plot placeholder. There doesn't
appear to be any reason why the overlay can't also be
absolutely-positioned, so I've just removed the flag entirely.