I have created a chart and converted the chart into an image and displaying it using a servlet using this code :
OutputStream out = p_resp.getOutputStream();
p_resp.setContentType("image/jpeg");
chart = u.genarateLineChart("month);
ChartUtilities.writeChartAsJPEG(out, chart, 625, 800);
with this the web page contains only the chart image. I want to include in the web page a header for the chart as well as some data .
I tried to call this using html tags as follows but with no luck . Is there any way of displaying the chart with data too using servlets? I have tried the “img” tag too.
I do not want to create an image of the chart and store it in a temporary location .
update 1:
I am using the below given code in order to open the image in a webpage :
HTMLHelper.writeHTMLHead(m_out);
m_out.println("<body bgcolor=\"#B4A383\"> "
+ " <center> "
+ " <img src=\"/dashboard/_imgs/sungard_martini.png\" alt=\"SunGard Martini\" border=\"0\" /> "
+ " <p><br><br></p>");
m_out.println(
" <div align=center>"
+ " <img src=\"/servlet/servlet-name" border=\"0\" /> "
+"</div>"
+ " <p><br><br></p>");
Thanks,
Bhavya
Encode the image as base64, then embed it using the general form: