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.
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.
* If either color or width is object, normalize the other to object
* Only draw each border if its width is greater than 0
* Set strokeStyle and lineWidth _before_ calling ctx.beginPath()
Pull request #50 inadvertently broke the behavior of axis.tickDecimals,
which previously added precision up to the given value. The broken code
effectively ignored the setting for values with less precision. This
fix brings back the old behavior.
The recent changes to add retina support included a call to getContext
made before excanvas/flashcanvas had a chance to register their hooks;
fixed by moving that code up a few lines.
As the size of the variation increases, the resulting colors approach
white and black. To avoid this we now reset the variation when it gets
too large. This results in repeated colors, but that's much better than
a list full of whites and blacks.
Check whether an axis has a generator, rather than a mode. In most cases
this is functionally the same, but it also handles the case where an
axis mode plug-in specifies only the formatter, and expects to use the
default base-10 generator.
Added a legend 'sorted' option that allows sorting of legend entries
independent of series order. It accepts either null/false, true,
'ascending', 'descending' or a comparator function.