PDA

View Full Version : Exporting OFC Chart



babyblue
14 Aug 2009, 10:52 AM
Anyone have experience exporting the chart as image? Or exporting the whole window, etc?

http://teethgrinder.co.uk/open-flash-chart-2/save-as-image-menu.php

I'm not a java script person, how can I go about using that's on that page?

Thanks in advance.

Arno.Nyhm
17 Aug 2009, 1:28 AM
i think you can do it with a little JSNI and a server component.

to use the given javascript examples you can get the chart element with
getSwfId()


but after a research i found this issue with good samples

http://code.google.com/p/ofcgwt/issues/detail?id=25

also look at the attachement in this google issue from
> Comment 2 by Andigator, Feb 18, 2009
> ofcgwt_ImageSample.zip (21.1 KB Download)

here the key code is this:

public class ExtendedChartWidget extends ChartWidget {

public String getImageData() {
return getImageData(getSwfId());
}

private native String getImageData(String id)
/*-{
var swf = $doc.getElementById(id);
var data = swf.get_img_binary();
return data;
}-*/;

}look also at this places:

http://groups.google.com/group/ofcgwt/browse_frm/thread/4b46101836ddc7b5
http://groups.google.com/group/ofcgwt/browse_frm/thread/5890b91a52532e79

http://code.google.com/p/ofcgwt/source/browse/trunk/src/com/rednels/ofcgwt/client/ChartWidget.java
http://code.google.com/p/ofcgwt/source/browse/#svn/trunk/test/com/gwttest/server


or ask the opener of this thread to look at your thread:
http://extjs.com/forum/showthread.php?t=48627

nolio
4 Aug 2010, 12:50 AM
Hi guys,

Is there a proper way to export the chart into an image? I checked the js and php examples noted here, but I cannot embed them in my code.

Did any of you find a GXT solution?

The_Jackal
4 Aug 2010, 4:16 PM
If GXT provided a version I'm sure it would look like the example above - note that it's not PHP code in the example it's GWT code