HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.45k stars 528 forks source link

Draw legend outside plot and include it when exporting to image? #178

Closed bishma-stornelli closed 11 years ago

bishma-stornelli commented 11 years ago

I've seen it's possible to draw the legend outside the plot but when exporting to png or jpeg, the legend doesn't exists.

Is it possible to draw the legend, let's say, to the right of the plot (outside it) and include it in the image?

I'm using this example http://www.humblesoftware.com/flotr2/#!download-image to transform it to image.

cesutherland commented 11 years ago

To draw the legend outside of the plot, it must be drawn with HTML. This in-general breaks the to-image functionality.

I don't plan to fix this at this time as the delta between canvas and HTML is pretty large. A work around could be to have the observers for your to-image controls draw the chart a second time with HtmlText : false, and get the image version of that chart. This could all be done in the background (some offscreen or invisible div).