Integration with Vaadin
#1
Posted 13 January 2010 - 09:15 AM
Thanks
Chris
Other Replies To This Topic
#2
Posted 14 January 2010 - 12:19 AM
Welcome to FusionCharts Forum.
We have not implemented FusionCharts with vaadin.
If we implement it, we will definitely post the solution here.
Other Replies To This Topic
#3
Posted 15 January 2010 - 02:56 AM
just in case here is an example that I am having problems with:
package com.example.fusionchartapplication;
import com.vaadin.Application;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Window;
public class FusionchartapplicationApplication extends Application
{
@Override
public void init()
{
this.setTheme("fusionchartapplicationtheme");
Window w = new Window();
setMainWindow(w);
w.addComponent(getChart());
}
public Component getChart()
{
// Create a Shockware Flash resource
final ThemeResource flashResource = new ThemeResource(
"swf/FCF_Column3D.swf");
final Embedded chart = new Embedded("Chart Caption", flashResource);
chart
.setCodebase("http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0");
chart.setClassId("clsidemoticon27CDB6E-AE6D-11cf-96B8-444553540000");
chart.setType(Embedded.TYPE_OBJECT);
chart.setMimeType("application/x-shockwave-flash");
chart.setWidth(700);
chart.setHeight(500);
chart.setParameter("id", "Column3D");
chart.setParameter("movie", "FCF_Column3D.swf?width=600&height=500");
chart
.setParameter(
"FlashVars",
"&dataXML= ");
chart.setParameter("quality", "high");
return chart;
}
}
Other Replies To This Topic
#4
Posted 16 January 2010 - 12:30 AM
You are most welcome.
Thanks for sharing the example.
We will definitely let you know as soon as we come up with the implementation.
Happy FusionCharting.
Other Replies To This Topic
#5
Posted 19 January 2010 - 03:16 AM
Example below
w.addURIHandler(new URIHandler()
3 {
4
5 public DownloadStream handleURI(java.net.URL context,
6 String relativeUri)
7 {
8 if (relativeUri.startsWith("Data.xml"))
9 {
String myString = "&dataXML= ";
byte currentXMLBytes[] = myString.getBytes();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
currentXMLBytes);
return new DownloadStream(byteArrayInputStream, null, null);
10 {
11 }
12 }
This works fine for one chart on a page, but when there are many charts on the same page this code breaks.
I am not a JSP, Java Script nor HTML guy ..... so I am a bit lost here.
Is there a way to give every chart a specific name so the relativeURL is not Data.xml (default) for every chart ?
Thanks
Chris
Other Replies To This Topic
#6
Posted 19 January 2010 - 04:03 AM
Could you please set a unique embed id and DomId for every chart, so that each chart has a pair of unique Ids?
The relativeURL name can be anything. In case nothing is provided in the relativeURL path then the apllication searches for a file named Data.xml
Other Replies To This Topic
#7
Posted 19 January 2010 - 06:24 AM
Thanks for your help
Chris
Other Replies To This Topic
#8
Posted 19 January 2010 - 06:36 AM
You are most welcome. ![]()
Hope your issue gets resolved.
We will also let you know as soon as we come up with the implementation.
Happy FusionCharting.
Other Replies To This Topic
#9
Posted 21 January 2010 - 01:40 AM
Other Replies To This Topic
#10
Posted 21 January 2010 - 01:45 AM
That's good news for us.
Could you please attach the entire codes here for future reference?
Other Replies To This Topic
Other Replies To This Topic
#12
Posted 21 January 2010 - 03:55 AM
We should thank you for implementing FusionCharts in Vaadin, a direction we had not explored before.
Other Replies To This Topic
#13
Posted 22 January 2010 - 07:36 AM
Chris
PS: had to remove the vaadin jar file from project due to size limit
Other Replies To This Topic
#14
Posted 22 January 2010 - 07:43 AM
Thanks loads!
You are a savior for the future users of FusionCharts with Vaadin.
Cheers!
Other Replies To This Topic
Other Replies To This Topic
#16
Posted 22 January 2010 - 09:45 PM
Yea we thank Sami as well as you for introducing this new architecture into the forum.
If you do further implementations with Vaadin, do keep posting here.
Thanks again.
Other Replies To This Topic
#17
Posted 21 April 2010 - 01:34 AM
This topic getting old, but here is a small example how to use FusionCharts in a Vaadin application:
// Resource for the FusionCharts SWF file of desired chart type.
// Here we have them stored as a Java class resources along with this class.
Resource chartResource = new ClassResource("MSColumn3D.swf", this);
// The Embedded component to present the Flash object
Embedded chart1 = new Embedded(null, chartResource);
win.addComponent(chart1);
// Set size properties for the chart
chart1.setWidth("400px");
chart1.setHeight("300px");
// dataUrl maps to URIHandler below.
chart1.setParameter("FlashVars", "dataUrl=data-1.xml");
// URI Handler that streams a XML data from Java class resource.
// This could return completely dynamic data as an InputStream.
win.addURIHandler(new URIHandler() {
private static final long serialVersionUID = 1L;
public DownloadStream handleURI(URL context, String relativeUri) {
if (relativeUri.startsWith("data-1")) {
return new DownloadStream(getClass().getResourceAsStream(
relativeUri), "application/xml", relativeUri);
}
return null;
}
});
Other Replies To This Topic
#18
Posted 26 April 2010 - 12:25 AM
Thanks once again for the example.
Happy FusionCharting.
Other Replies To This Topic
#19
Posted 02 September 2010 - 06:58 AM
or maybe is there any built in charting tool in vaadin like the one in GXT?
thanks in advance...
This topic is locked

Back to top
MultiQuote