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.