To improve the level of responsiveness as well as enhancing support for
different server architectures, Chart FX provides two ways of processing and
returning charts to the browser. These mechanisms are provided by 2 methods: the getHtmlTag
method and the getHtmlData method.
When a user hits a page containing the getHtmlTag method; a chart file is saved
to disk and an HTML tag (IMG, OBJECT) is returned so the browser can know the
location of the chart file on the web server. Finally a second trip back to the
server is necessary to pull the chart from the server and display it on the
page as a static image or an active component. One of getHtmlTag's greatest
advantages is that charts can be easily integrated into your existing JSP pages
and it allows support for automatic browser detection. However, saving a file
to disk can take its toll on server performance.
On the other hand, the getHtmlData method prevents the chart file from being
saved to disk by bit-streaming the chart directly to the browser; this process
leads to fewer round-trips between the client and the server. However,
integration into the JSP page is awkward because you must point to another JSP
file that returns the bit-stream to the browser. Also, no browser detection is
provided using this methodology, preventing your application from making "smart"
decisions based on the user's browser capabilities.
In terms of performance, you will learn that although the getHtmlData method is
processor intensive it allows developers to boost performance and scalability
and it permits the use of Chart FX on intricate server architectures such
as web farms.
|