Creating a Chart Image Without Downloading a File
This technique is used when a chart image (PNG or JPEG) will be generated by the server side component. The idea is as simple as including the <IMG> tag wherever you want the chart to be displayed and the SRC parameter points to the file that generates the BitStream by invoking the getHtmlData method. The IMG tag should read as follows:
The chart.jsp file will contain the necessary code that generates the desired chart and invokes the getHtmlData method as a result of
the page. A very important issue when generating this .aspx page is to make sure there are no other HTML tags or Line feeds in the resulting file as the chart may not be correctly returned and displayed in the browser. In other words,
make sure the chart.jsp file only returns the results of the getHtmlData method with no additional characters. For example a valid chart.jsp file may look like:
<%
ChartServer chart1 = new ChartServer(application,request,response);
chart1.getHtmlData("400","240","PNG"); %>
|
Please remember there must not be any spaces or carriage returns before the start of the jsp code (<%). If you press [Enter] then a carriage return will
be generated in the result of the jsp and the IMG source will not be able to
read the image generated by Chart FX for Java. Therefore it is
strongly advised that you use a plain text editor when generating these files as many advanced editors may include undesired HTML tags in the resulting file.
IMPORTANT NOTE: If you are using "Image Maps" in the charts, you should be aware that this feature is not supported when using the BitStream generation.
The Method getHtmlDataEX should be used intead.
|