FusionCharts Forum: Integration with Vaadin - FusionCharts Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Integration with Vaadin

#1 User is offline   croffler 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 13-January 10

Posted 13 January 2010 - 09:15 AM

Has anybody integrated FusionChart with vaadin (www.vaadin.com)?





Thanks

Chris
0

Other Replies To This Topic

#2 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 14 January 2010 - 12:19 AM

Hello,

Welcome to FusionCharts Forum.

We have not implemented FusionCharts with vaadin.

If we implement it, we will definitely post the solution here.

Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#3 User is offline   croffler 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 13-January 10

Posted 15 January 2010 - 02:56 AM

Thanks



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;

	}

}


0

Other Replies To This Topic

#4 User is offline   Basundhara Ghosal 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2459
  • Joined: 15-September 09

Posted 16 January 2010 - 12:30 AM

Hi,

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. :)

Regards,

Basundhara Ghosal

Follow us on Twitter :D
0

Other Replies To This Topic

#5 User is offline   croffler 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 13-January 10

Posted 19 January 2010 - 03:16 AM

I have also a thread here :







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
0

Other Replies To This Topic

#6 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 19 January 2010 - 04:03 AM

Hello Chris,

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

Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#7 User is offline   croffler 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 13-January 10

Posted 19 January 2010 - 06:24 AM

The problem is on the Vaadin side , it seems to ignore all the parameters



Thanks for your help

Chris
0

Other Replies To This Topic

#8 User is offline   Basundhara Ghosal 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2459
  • Joined: 15-September 09

Posted 19 January 2010 - 06:36 AM

Hi Chris,

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.

Regards,

Basundhara Ghosal

Follow us on Twitter :D
0

Other Replies To This Topic

#9 User is offline   sami 

  • Forum Newbie
  • Group: Members
  • Posts: 2
  • Joined: 21-January 10

Posted 21 January 2010 - 01:40 AM

Hi,



I found a solution that works with Vaadin 6.2.



Read more at the Vaadin forums.
0

Other Replies To This Topic

#10 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 21 January 2010 - 01:45 AM

Hey Sami,

That's good news for us.

Could you please attach the entire codes here for future reference?

Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#11 User is offline   croffler 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 13-January 10

Posted 21 January 2010 - 03:53 AM

Thanks bunch



Chris
0

Other Replies To This Topic

#12 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 21 January 2010 - 03:55 AM

Hey Chris,

We should thank you for implementing FusionCharts in Vaadin, a direction we had not explored before. :)

Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#13 User is offline   croffler 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 13-January 10

Posted 22 January 2010 - 07:36 AM

Here is an example



Chris



PS: had to remove the vaadin jar file from project due to size limit
0

Other Replies To This Topic

#14 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 22 January 2010 - 07:43 AM

Hello Chris,

Thanks loads!

You are a savior for the future users of FusionCharts with Vaadin.

Cheers!

Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#15 User is offline   croffler 

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 12
  • Joined: 13-January 10

Posted 22 January 2010 - 08:30 AM

Thank Sami over at Vaadin not me :cool:
0

Other Replies To This Topic

#16 User is offline   Madhumita 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 1434
  • Joined: 04-September 09

Posted 22 January 2010 - 09:45 PM

Hey Chris,



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.
Regards,
Madhumita Chakraborty

Follow us on Twitter :)
0

Other Replies To This Topic

#17 User is offline   sami 

  • Forum Newbie
  • Group: Members
  • Posts: 2
  • Joined: 21-January 10

Posted 21 April 2010 - 01:34 AM

Hi,



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;

            }

        });


0

Other Replies To This Topic

#18 User is offline   Basundhara Ghosal 

  • Supreme Being
  • PipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 2459
  • Joined: 15-September 09

Posted 26 April 2010 - 12:25 AM

Hi Sami,

Thanks once again for the example.

Happy FusionCharting. :)

Regards,

Basundhara Ghosal

Follow us on Twitter :D
0

Other Replies To This Topic

#19 User is offline   cutout33 

  • Forum Newbie
  • Group: Members
  • Posts: 1
  • Joined: 01-September 10

Posted 02 September 2010 - 06:58 AM

Hi Am interested in using fusioncharts with vaadin but the above example gives "error loading data", is there any update for it, also can I read charts data from DB directly?



or maybe is there any built in charting tool in vaadin like the one in GXT?



thanks in advance...
0

Other Replies To This Topic

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked