Hi ,
I am using JHTML and want to use the JFREE charts to display the charts on the Pages.
Can anybody let me know the way how to use JFREE charts with the JHTMLs.
Using JFree Chart with JHTML
Re: Using JFree Chart with JHTML
It's not something I can help with, since I know nothing about JHTML. Anyone else?
Regards,
DG.
Regards,
DG.
Re: Using JFree Chart with JHTML
anytime you want to show a chart on the web it will be the exact same procedure:
make a servlet that generates your chart as a jpeg, gif, or png (be sure to set the something along the lines of (only doGet method shown):
public void doGet(HttpServletRequest request, HttpServletResponse response) {
//change these as appropriate
int width = 500;
int height =500;
JFreeChart chart = generateChart(request); //need to fill in this method yourself
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ChartUtilities.writeChartAsJPEG(baos, chart, width, height);
response.setContentType ("image/jpeg");
response.setContentLength(baos.size());
baos.writeTo(out);
}
then include an img tag in your jhtml page with the url of your servlet as the src attribute.
make a servlet that generates your chart as a jpeg, gif, or png (be sure to set the something along the lines of (only doGet method shown):
public void doGet(HttpServletRequest request, HttpServletResponse response) {
//change these as appropriate
int width = 500;
int height =500;
JFreeChart chart = generateChart(request); //need to fill in this method yourself
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ChartUtilities.writeChartAsJPEG(baos, chart, width, height);
response.setContentType ("image/jpeg");
response.setContentLength(baos.size());
baos.writeTo(out);
}
then include an img tag in your jhtml page with the url of your servlet as the src attribute.
Re: Using JFree Chart with JHTML
the second paragraph should be:
make a servlet that generates your chart as a jpeg, gif, or png (be sure to set the content type and content length headers). something along the lines of (only doGet method shown):
make a servlet that generates your chart as a jpeg, gif, or png (be sure to set the content type and content length headers). something along the lines of (only doGet method shown):
Re: Using JFree Chart with JHTML
I am not using the servlets with the JHTMLs. Bean shells scripts are used with the ATG Dynamo Server. I am not able to instantiate the classes as we do in JSP and Servelts .
If somebody is having any idea about that then that would be really helpful. we are having DynamoHttpRequest and resonse object only .
If somebody is having any idea about that then that would be really helpful. we are having DynamoHttpRequest and resonse object only .