Making a fancy GWT Chart

44 views
Skip to first unread message

Nether

unread,
Aug 29, 2009, 8:47:30 PM8/29/09
to Google Web Toolkit
My goal is to make a chart which shows standard deviations as a
gradient on the vertical axis. I don't think it is easy to do this in
the browser, so what I plan on doing is having the server render the
chart to a BufferedImage and sending that to the client to display in
an "Image" widget.

The problem is that the Image widget only takes a URL, but how do I
give it a bufferedimage?

Also, is this the best solution for me to be using for making this
gradient chart?

Thanks for your time.

ThomasWrobel

unread,
Aug 30, 2009, 5:35:54 AM8/30/09
to Google Web Toolkit
I dont know much about sever-side rendering, but cant the sever render
the image to a url, possibly triggered by gwt calling a php function?

Also, have you looked into the possibility of GWTCanvas being used to
draw with gwt?
http://code.google.com/p/google-web-toolkit-incubator/wiki/GWTCanvas

It can handle gradients......but not in IE.
(if its just liner gradients on rectangles though, you could also just
do it yourself by drawing lots of lines changing the color each time).

Sri

unread,
Aug 30, 2009, 11:56:24 AM8/30/09
to Google Web Toolkit
There are multiple ways to achieve this -

If you want to continue generating images in java, you will also have
to write a Servlet which returns the BufferedImage in one of the
formats (gif/jpeg etc). Then, in your ImageWidget you would give the
URL for your servlet. In the servlet, you would do something like this
-
a) Read the request parameters and created a BufferedImage
b) Set the appropriate content-type request headers to the tell the
browser that you are sending an image ('image/jpg' or 'image/gif'
etc)
c) Use the ImageIO class to copy the BufferedImage to the servlets
output stream

You can also take a look at FusionCharts. It provides a flash based
client side graph/chart library. In this case, you would have to
create an XML in your client side code and then pass it to
FusionCharts using its Javascript API.

Joseph Arceneaux

unread,
Aug 30, 2009, 5:25:58 PM8/30/09
to google-we...@googlegroups.com
So what is the technology behind Google finance?  This seems to me to be Ajax-powered, client-side created charts and graphs...

mars1412

unread,
Aug 31, 2009, 5:14:31 AM8/31/09
to Google Web Toolkit
maybe you could use 3rd party libs:
http://code.google.com/p/gchart/

On Aug 30, 2:47 am, Nether <mirr...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages