GWT Integration

63 views
Skip to first unread message

micha

unread,
Feb 16, 2009, 4:59:26 AM2/16/09
to Google Chart API
Hi,

i'd like to know if someone ever successfully tried to integrate the
charts4j library into a GWT project? I always get the error "No source
code is available for type ..." when using any class from charts4j. I
already created a jar file that contains both .class and .java files
but that didnt help.

Any help is highly welcome.
Michael

JMan

unread,
Feb 16, 2009, 10:49:04 AM2/16/09
to Google Chart API
Hi Micha.

I have not played around with the GWT. However, ultimately, the
charts4j is simply a small Java library that produces a Google Chart
API URL string (ex: http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World).
There is nothing special about it or GWT specific. As a result,
charts4j can work in any Java environment -- as long as you are
connected to the Internet.

Embed those URLs in an image tag and you are done -- however you do
that in GWT. In Model-View-Controller parlance, build the URLs in the
GWT model, and display them in the GWT view.

This question comes up a lot, so I will try to provide an example in
the next few weeks.

-Julien
http://charts4j.googlecode.com

Andrew Lang

unread,
Feb 16, 2009, 11:22:28 AM2/16/09
to google-c...@googlegroups.com, google-chart-a...@googlegroups.com


 
| second life consultant | professor of mathematics | blog | flickr | youtube |




> Date: Mon, 16 Feb 2009 07:49:04 -0800
> Subject: Re: GWT Integration
> From: Julien.C...@gmail.com
> To: google-c...@googlegroups.com

micha

unread,
Feb 17, 2009, 7:16:20 AM2/17/09
to Google Chart API
Hi Julien,

thank you for that quick reply.

I guess I need to clarify that I want to use charts4j from the client
side of GWT (no MVC yet). For all the Java-Code that is used on the
client, GWT needs the source code the generate JavaScript. And the
error message that I get ("No source code is available for type ...")
indicates that the source code for charts4j can not be found although
I added it to the charts4j.jar.

I guess you're right that this is no charts4j problem in particular
but a GWT problem in general. But since this is the library I want to
integrate I was wondering if somebody ever got this to work
successfully.

Regards
Michael

On Feb 16, 4:49 pm, JMan <Julien.C.Chast...@gmail.com> wrote:
> Hi Micha.
>
> I have not played around with the GWT. However, ultimately, the
> charts4j is simply a  small Java library that produces a Google Chart
> API URL string (ex:http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl...World).
> There is nothing special about it or GWT specific. As a result,
> charts4j can work in any Java environment -- as long as you are
> connected  to the Internet.
>
> Embed those URLs in an image tag and you are done -- however you do
> that in GWT. In Model-View-Controller parlance, build the URLs in the
> GWT model, and display them in the GWT view.
>
> This question comes up a lot, so I will try to provide an example in
> the next few weeks.
>
> -Julienhttp://charts4j.googlecode.com

JMan

unread,
Feb 17, 2009, 12:33:10 PM2/17/09
to Google Chart API
Hi again Micha.

The old name for this project was gchartjava. Back then someone wrote
a GWT port: http://code.google.com/p/gwt-gchartjava/

I do not know much about it, but perhaps it can be a starting point.

Thanks for your interest in this project.

-Julien
http://charts4j.googlecode.com

On Feb 17, 5:16 am, micha <miv...@googlemail.com> wrote:
> Hi Julien,
>
> thank you for that quick reply.
>
> I guess I need to clarify that I want to use charts4j from the client
> side of GWT (no MVC yet). For all the Java-Code that is used on the
> client, GWT needs the source code the generate JavaScript. And the
> error message that I get ("No source code is available for type ...")
> indicates that the source code for charts4j can not be found although
> I added it to the charts4j.jar.
>
> I guess you're right that this is no charts4j problem in particular
> but a GWT problem in general. But since this is the library I want to
> integrate I was wondering if somebody ever got this to work
> successfully.
>
> Regards
> Michael
>
> On Feb 16, 4:49 pm, JMan <Julien.C.Chast...@gmail.com> wrote:
>
> > Hi Micha.
>
> > I have not played around with the GWT. However, ultimately, the
> > charts4j is simply a  small Java library that produces a Google Chart
> > API URL string (ex:http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl...).

micha

unread,
Feb 20, 2009, 3:22:40 AM2/20/09
to Google Chart API
Ok,

now I got the answer to the problem. First I created a decent GWT
module with the source code of charts4j and a charts4j.gwt.xml
containing:
<module>
<source path="charts4j" />
</module>

But then I found out it cant be done the way wanted. Unfortunately.
The problem is that there are some JRE-types used in charts4j, that
are not covered by the GWT-compatible subset of the JRE, eg:
DecimalFormat, URLEncoder. In the end this means that this library
cannot be used on the client side of a GWT application.

I'll now have a look at the GWT Port you suggested or using it in a
proper way (on the server side).

Cheers
Michael

On 17 Feb., 18:33, JMan <Julien.C.Chast...@gmail.com> wrote:
> Hi again Micha.
>
> The old name for this project was gchartjava. Back then someone wrote
> a GWT port:http://code.google.com/p/gwt-gchartjava/
>
> I do not know much about it, but perhaps it can be a starting point.
>
> Thanks for your interest in this project.
>
> -Julienhttp://charts4j.googlecode.com

JMan

unread,
Feb 20, 2009, 2:48:52 PM2/20/09
to Google Chart API
Hi again Michael.

Argh! That is a frustrating limitation of GWT. If you want to take a
stab at porting charts4j to GWT, I can probably give you some hints
and suggestions. You could start a project at Google Code. All the
Java APIs I use in charts4j are very standard, so hopefully, there
would not be too many problems like this.

-Julien
http://charts4j.googlecode.com

micha

unread,
Feb 22, 2009, 7:34:09 AM2/22/09
to Google Chart API
Hi Julien,

it would be nice if you could give me some hints about porting
charts4j. Maybe I can have a look at it...

Cheers
Michael

On Feb 20, 8:48 pm, JMan <Julien.C.Chast...@gmail.com> wrote:
> Hi again Michael.
>
> Argh! That is a frustrating limitation of GWT. If you want to take a
> stab at porting charts4j to GWT, I can probably give you some hints
> and suggestions. You could start a project at Google Code. All the
> Java APIs I use in charts4j are very standard, so hopefully, there
> would not be too many problems like this.
>
> -Julienhttp://charts4j.googlecode.com
Reply all
Reply to author
Forward
0 new messages