|
Barchart Image not getting displayed on the browser.....(using JSP to generate Bar Chart) |
Posted by Abhishek on Feb-07-2005 19:01 |
|
Hi......
I am using the jsp format to display the charts. I amn't getting the chart images displayed on the browser even if there is no error in my jsp.
Here is the sample code I am using to display the chart image.........
<%
String chart1URL = c.makeSession(request, "chart1");
//include tool tip for the chart
String imageMap1 = c.getHTMLImageMap("", "", "title='{xLabel}: US${value}K'");
%>
<html>
<body topmargin=0 leftmargin=5 rightmargin=0>
<div style="font-size:18pt; font-family:verdana; font-weight:bold">
Simple Bar Chart </div> <hr color="#000080">
<div style="font-size:10pt; font-family:verdana">
<a href="viewsource.jsp?file=<%=request.getServletPath()%>">
View Chart Source Code </a> </div> <br> <img src="getchart.jsp?<%=chart1URL%>" usemap="#map1" border="0">
<map name="map1"><%=imageMap1%></map>
</body> </html>
Please help me .....
Thanks in advance...
Abhishek |
Re: Barchart Image not getting displayed on the browser.....(using JSP to generate Bar Chart) |
Posted by Peter Kwan on Feb-08-2005 03:11 |
|
Hi Abhishek,
First, just to confirm if you have copied "getchart.jsp" to your JSP directory. The code above uses:
<img src="getchart.jsp?<%=chart1URL%>" usemap="#map1" border="0">
So it needs "getchart.jsp" to be located in the same directory as your JSP script.
Also, the above code requires cookie support to work. If your server or your browser is configured to disable cookies, the above maynot work. In this case, please replace the above <IMG> tag with the following tag, which can work with and without using cookies:
<img src='<%=response.encodeURL("getchart.jsp?"+chart1URL)%>'
usemap="#map1" border="0">
If the above still does not solve the problem, please copy the exact original "simplebar.jsp" and "getchart.jsp" to your web server and try it to see if it works.
If you still cannot see the chart image, but you do see other HTML text, and also a "red X" (the broken image symbol), then please right click on the red X, and select Properties. You should see the URL of the "red X". Please cut and paste the complete URL to your browser address bar and hit enter. Your browser will then access the chart image directly, and you can see any error message (instead of seeing the red X). Please inform me of the exact error message.
Regards
Peter Kwan |
Re: Barchart Image not getting displayed on the browser.....(using JSP to generate Bar Chart) |
Posted by Abhishek on Feb-08-2005 11:27 |
|
Hi...
Thanks for the quick response. I got the problem solved.Now I have to include the bars in the bar chart for user visits of a particular site in each of the months. I have month's name along the x axis and the visit count along the y axis.
The problem is that How will the bar chart recognize that it has to add the bar for which month ? say I have got the result for the month of Jan then how will my bar chart know that it has to show the bar for January only,not for other months . Another problem is that every time I am refreshing the jsp page the bar is getting added for the next month.How can it be locked so that the new bars should not be get loaded on the jsp page.
Again thanks ...
Abhishek |
Re: Barchart Image not getting displayed on the browser.....(using JSP to generate Bar Chart) |
Posted by yashwanthReddy on Jul-29-2015 22:40 |
|
hi Abhishek
I also got the same problem.can you please brief me how you solved |
Re: Barchart Image not getting displayed on the browser.....(using JSP to generate Bar Chart) |
Posted by Peter Kwan on Jul-30-2015 04:24 |
|
Hi yashwanthReddy,
The ChartDirector edition used in this thread is "ChartDirector for JSP/Java". For this particular case, the issue is either due to the getchart.jsp not copied to the script directory, or JSP session variables are not configured properly.
There are probably thousands of possibility why a chart cannot be displayed. To diagnose the problem, please let me know which edition of ChartDirector you are using, and what is the error message. If the chart is not displayed, what is displayed? If what you see is a broken image symbol, please go into the symbol and see what is the error message inside the symbol. (See the following FAQ article on how to read the error message inside a broken image symbol:
http://www.chartdir.com/forum/download_thread.php?site=chartdir&bn=chartdir_faq&thread=1117817200
Regards
Peter Kwan |
Re: Barchart Image not getting displayed on the browser.....(using JSP to generate Bar Chart) |
Posted by Abhishek on Feb-08-2005 11:27 |
|
Hi...
Thanks for the quick response. I got the problem solved.Now I have to include the bars in the bar chart for user visits of a particular site in each of the months. I have month's name along the x axis and the visit count along the y axis.
The problem is that How will the bar chart recognize that it has to add the bar for which month ? say I have got the result for the month of Jan then how will my bar chart know that it has to show the bar for January only,not for other months . Another problem is that every time I am refreshing the jsp page the bar is getting added for the next month.How can it be locked so that the new bars should not be get loaded on the jsp page.
Again thanks ...
Abhishek |
Re: Now the problem is ....(using JSP to generate Bar Chart) |
Posted by Abhishek on Feb-08-2005 11:41 |
|
Hi...
Thanks for the quick response. I got the problem solved.Now I have to include the bars in the bar chart for user visits of a particular site in each of the months. I have month's name along the x axis and the visit count along the y axis.
The problem is that How will the bar chart recognize that it has to add the bar for which month ? say I have got the result for the month of Jan then how will my bar chart know that it has to show the bar for January only,not for other months . Another problem is that every time I am refreshing the jsp page the bar is getting added for the next month.How can it be locked so that the new bars should not be get loaded on the jsp page.
Again thanks ...
Abhishek |
Re: Now the problem is ....(using JSP to generate Bar Chart) |
Posted by Peter Kwan on Feb-08-2005 17:24 |
|
Hi Abhishek,
ChartDirector will display the data you pass to it. Suppose you pass 2 data values (10, 20) to ChartDirector, and 2 labels ("Jan", "Feb"), then ChartDirector will draw 2 bars and label them on the x-axis as "Jan" and "Feb".
If you do not add bars to your data, then ChartDirector will not add bars to the chart. In general, ChartDirector will not automatically add data or remove data. It will only display the data you pass to it.
If you refresh the JSP page and a new bar is added, would you mind to check if your code is adding the new data value to your data? You may modify your code so that it does not add the new data value to your data when the page is refreshed. This will solve the problem.
Regards
Peter Kwan |
|