I looked through the image map sample bundled with the download.
It seems that the following code:
<%
StringBuffer html=3D new StringBuffer( 100 );
ImageMap imageMap=3D (ImageMap) request.getAttribute( =
ChartServlet.IMAGE_MAP );
Iterator iterator=3D imageMap.getIterator();
while( iterator.hasNext() )
{
ImageMapArea imageMapArea=3D (ImageMapArea) iterator.next();
=20
html.append( "href=3D\"javascript:showValues(" );
html.append( imageMapArea.getValue() );
html.append( ",'" );
html.append( imageMapArea.getLengendLabel() );
html.append( "','" );
html.append( imageMapArea.getXAxisLabel() );
html.append( "');\"" );
%>
<%=3D imageMapArea.toHTML( html.toString() ) %>
<%=20
//---reuse same StringBuffer Object
html.delete( 0, html.length() );
}=20
%>
produces something like:
href=3D"javascript:showValues(1500.0,'Bugs','1995');"
href=3D"javascript:showValues(6880.0,'Bugs','1996');"
href=3D"javascript:showValues(4510.0,'Bugs','1997');"
href=3D"javascript:showValues(2600.0,'Bugs','1998');"
href=3D"javascript:showValues(1200.0,'Bugs','1999');"
href=3D"javascript:showValues(1580.0,'Bugs','2000');"
href=3D"javascript:showValues(8000.0,'Bugs','2001');"
href=3D"javascript:showValues(4555.0,'Bugs','2002');"
href=3D"javascript:showValues(4000.0,'Bugs','2003');"
href=3D"javascript:showValues(6120.0,'Bugs','2004');"
But this is not the complete area tag. Is there some method that will =
let me get something like:
<area shape=3D"rect" coords=3D"20,20,60,60" =
href=3D"javascript:showValues(6120.0,'Bugs','2004');">
The methods that would help in generating this seem to be protected or =
non-existent. Am I missing something?
- Vikram
|