Reputation: 5470
We developed a complex reporting application using flot however something that I did not foresee is that we were going to have an issue with the output, although everything looks and works cool the Business users cannot copy the chart in their presentations because the output is a canvas element.
I've looked for several approaches I even found a way to convert the canvas to an image but this only works on HTML5 supported browsers, unfortunately our users use IE7 I know this is very old but there is nothing I can do (trust me we tried) so I have to come up with a solution to export the graph to an image format.
My last attempt was using fxcanvas and flashcanvas to emulate the toDataURL method but turns out there is a 32kb buffer where my images are at least 300kb.
Business users (upper management) is pushing for a solution and they clearly don't understand there are technical boundaries here, I'm open to any solution that does not involve the following:
However I'm open to any Active X solution or any export option that does not require installing 3rd party programs (except for MS libraries where they dont' have to perform any addiontal step like registering libraries).
Upvotes: 1
Views: 110
Reputation:
The basic way to do it is using canvas.toDataURL("image/png");
but I also found this link for you
http://nihilogic.dk/labs/canvas2image/
I've not tested it.
Upvotes: 1
Reputation: 4834
If you want the users to get the same result (or at least as close as possible), why not try relying a bit on the backend?(assuming there is one) Just generate the image on the backend and output a standard jpg or png.
I can't really think of another solution, even the SVG is compatible only on IE7+, the closest solution without using backend would be using flash, as it's a third party but it's pretty known and it's built-in on the modern browsers.
Relying on the client side always involve: Asking them to upgrade the browser/ Using a third party plugin, so keep an eye on that in the future projects planning, the compatibility issues are one of the most annoying in my opinion in web development
Upvotes: 0