Convert flot to image

2,192 views
Skip to first unread message

rocioc...@gmail.com

unread,
Dec 3, 2008, 7:52:26 AM12/3/08
to Flot graphs
Hi all!!

Someone knows how to convert the flot graphs to an image?

Thanks a lot.

PD: Sorry for my bad english.

Jonathan Leto

unread,
Dec 4, 2008, 12:12:01 PM12/4/08
to flot-...@googlegroups.com
Howdy,

Currently, to my knowledge, it is not possible to directly export Flot
graphs as images, they are interactive javascript "widgets" sitting on
the page, they are not PNGs/etc.

If someone has any ideas about how this could be accomplished, speak up!

Cheers,

--
[---------------------]
Jonathan Leto
jal...@gmail.com

kingofthelowend

unread,
Jan 31, 2009, 4:05:19 PM1/31/09
to Flot graphs
I am VERY interested in this feature as well!

On Dec 4 2008, 12:12 pm, "Jonathan Leto" <jal...@gmail.com> wrote:
> Howdy,
>
> Currently, to my knowledge, it is not possible to directly export Flot
> graphs as images, they are interactive javascript "widgets" sitting on
> the page, they are not PNGs/etc.
>
> If someone has any ideas about how this could be accomplished, speak up!
>
> Cheers,
>
> On Wed, Dec 3, 2008 at 4:52 AM, rociocoba...@gmail.com

Anthony Ettinger

unread,
Feb 1, 2009, 12:17:04 AM2/1/09
to flot-...@googlegroups.com
Me too, although more from an academic point of view -- I don't really
need it, but if it were possible... :)

--
Anthony Ettinger
408-656-2473
http://anthony.ettinger.name

Fabien

unread,
Feb 1, 2009, 6:42:32 AM2/1/09
to Flot graphs
Hello, I know it is possible, I did it with Flotr (http://
code.google.com/p/flotr/). Don't think I want to promote this library
here, if you want to get inspiration from it, you are free to : Flotr
was inspired from Flot ;)
The only problem is that it will never work on Internet Explorer until
it supports natively the <canvas> tag (and it won't in IE8 :'( )

Carl Crowder

unread,
Feb 1, 2009, 6:06:54 AM2/1/09
to flot-...@googlegroups.com
I was looking into that myself. Check out "canvas to image":

http://www.nihilogic.dk/labs/canvas2image/

I haven't tried it yet but it looks promising

Carl

Fabien

unread,
Feb 1, 2009, 8:34:03 AM2/1/09
to Flot graphs
In fact, I'm using an improved version of this library in Flotr. It is
a little faster and makes 32bit bitmaps (with alpha) instead of 24
bits. I'll try to give this new version to the original author.

1000i1

unread,
Feb 10, 2009, 10:48:41 AM2/10/09
to Flot graphs
Canvas2Image works great, but it doesn't display the axis values. So
in my case it's useless. Anyone knows how to display axis info when
exporting to image?

Fabien

unread,
Feb 10, 2009, 1:40:06 PM2/10/09
to Flot graphs
Axis info must be drawn into the canvas area. This can be done in a
few browsers (It is supported in Firefox 3.1 and Webkit nightly
builds, like in Chrom[e|ium] 2.0). The text must then be drawn using
another method, because IE, Firefox 3.0 and others don't support it.
Search "canvastext" in Google and you'll find some of them.

tfischer

unread,
Mar 31, 2009, 12:09:30 PM3/31/09
to Flot graphs
Could you help me get this to work? Could I see your code?

My flot graph is up and I originally used div tags. If I use canvas
tags then the plot disappears. My save image is basic:
window.onload = function() {
var oCanvas = document.getElementById("placeholder");
var strDataURI = oCanvas.toDataURI("placeholder");
}

Please help.

Benjamin

unread,
Apr 3, 2009, 5:09:03 AM4/3/09
to Flot graphs
If it can help ...

I use another method, with a great advantage : It work with all
browser.

In fact I use a software that convert html page into image (juste
search html2image on google)

Here are the steps :

->Step 1 : Install html2image and run the nweb server
->Step 2 : create a page html page with only the graphe (javascript +
html)
->Step 3 : create a link "download image" that call the nweb server
with the url in argument. The soft will generate an image on the hard
drive
->Step 4 : return the new image to the browser

that's all

tfischer

unread,
Apr 3, 2009, 12:25:53 PM4/3/09
to Flot graphs
$300 is a little steep to put on a server for one site.

Benjamin

unread,
Apr 6, 2009, 3:32:43 AM4/6/09
to Flot graphs
I think ther is not only one soft to do it and it's a good way to
explore.

Maybe it's possible to do it with Qt and webkit ...

Fabien

unread,
Apr 6, 2009, 5:45:01 AM4/6/09
to Flot graphs
I think a way to explore would be a Java Applet that would make a
screenshot of a part of the screen.
Or use the toDataUrl when available (everything except IE)
Reply all
Reply to author
Forward
0 new messages