Servlets can return text, HTML, images, pdf or whatever you want. Use the servlet to generate the chart and return it to the user. The process works something like this.
Your portlet generates the HTML. It sets the image src to some servlet with a customized query string. The browser renders the HTML. The browser has no idea this is a portlet. At this point it is just HTML. It renders the HTML as it knows how to do. When it finds an <img src=""> tag it makes another request to the server for the image.
When your portlet sets the image source it should do something like this
http://www.yourcompany.com/servlets/MyImageChartRenderer?imageData=whateverYouNeed&lots=more Inside the MyImageChartRenderer servlet set it's content type to whatever image type you want to return instead of HTML. Have the MyImageChartRenderer servlet use the query string data to render the chart image however you normally would with JFree. Then return the image back to the user instead of HTML.
Doing it this way your portlet only needs to dynamicaly change the url for the image source. That is just text manipulation. Portlet or not, this should always work.
[ January 23, 2006: Message edited by: Rusty Enisin ]