flot/flot — pull request #36 by rokstrnisa (2012-02-03 17:03:11+00:00)
Title: Add option to insert legend into canvas, instead.

Setting options.legend.type to "canvas" (default is "html") will now draw the
whole legend into the canvas (and also not display the HTML version).

This allows the legend to be visible when converting the canvas into an image.

The code was mostly taken from the flotCanvasText plugin for flot by Andre
Lessa (http://lessaworld.com). The redundant parts were removed, and the code
was simplified.

The whole change is encapsulated within a single function. Apart from this, an
extra option has been added (options.legend.type), and the legend hooks updated
accordingly. (Note that the insertLegend method had to be moved to a later
stage of the drawing process, since the canvas legend was otherwise getting
overwritten.)

Signed-off-by: Rok Strnisa