|
I am facing problem with encodeURL("getchart.jsp?"+chart1URL)%> |
Posted by dipak on Feb-12-2009 17:35 |
|
Hi I am trying to use trial version of chartdirector with liferay technology.I copied code on my jsp page from sam[le demo.
but i am not able to view the image.
I am facing problem with following tag.
<img src="<%=HttpUtil.encodeURL("getchart.jsp?"+chart1URL)%>" border="0" usemap="#map1">
<map name="map1">
<%=imageMap1%>
</map>
I am not sure that actual image is getting created.i like to know following things :-->
what is the location and name of temporary image.
what is the purpose of following tag
String imageMap1 = c.getHTMLImageMap("xystub.jsp", "", showText + hideText + toolTip) |
Re: I am facing problem with encodeURL("getchart.jsp?"+chart1URL)%> |
Posted by Peter Kwan on Feb-13-2009 04:03 |
|
Hi dipak,
I have not used liferay technology before, and so am not sure if the issue is related to liferay technology or not.
In any case, from your message, I assume you are putting the code in a JSP file (not another type of file). If you use the <img> tag, and it does not work, would you mind to inform me what is the error message? (Does you server produce any error message? Does the browser show any error message?)
If you get a "red X" (broken image), would you mind to inform me what is the error message inside the "red X"? See the following link if you are not sure how to read the error message inside the "red X".
http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_faq&thread=1117817200
Also, have you included the file "getchart.jsp" in the same directory as your JSP? (The <img> tag refers to the file "getchart.jsp", which can be find in the ChartDirector/jspdemo directory.)
The chart image is created in memory as a session variable. The "getchart.jsp" is used to read the chart image. If you prefer to create the chart image as a temporary file in the hard disk (so you can see it in the disk), you may use something like:
//make sure the tmpchart directory exists under your application directory, and is readable and writable
String chart1URL = c.makeTmpFile(application.getRealPath("/tmpchart"));
Then your <img> tag can point to your temporary file:
<img src='<%=request.getContextPath() + "/tmpchart/" + chart1URL%>' border="0" usemap="#map1">
The code that calls getHTMLImageMap is to create a HTML image map for the chart. It makes the chart clickable and has tooltips or Javascript events for the data points. The particular code you use seems to come from the Javascript Clickable Charts. In that sample code, the image map is set up to connect the mouse events of the data points to some Javascript code for hiding and showing additional data for the data points.
Hope this can help.
Regards
Peter Kwan |
|