|
From: Nathaniel G. A. <nat...@ya...> - 2003-05-14 12:50:49
|
Did you look at what the call to: "imageMapArea.toHTML( html.toString() )" does? It does what you
want. take a look at the javadocs and/or source for ImageMapArea.toHTML( String ) to see what it
does.
--- Vikram Rajan <vr...@st...> wrote:
> I looked through the image map sample bundled with the download.
>
> It seems that the following code:
>
> <%
> StringBuffer html= new StringBuffer( 100 );
> ImageMap imageMap= (ImageMap) request.getAttribute( ChartServlet.IMAGE_MAP );
>
> Iterator iterator= imageMap.getIterator();
> while( iterator.hasNext() )
> {
> ImageMapArea imageMapArea= (ImageMapArea) iterator.next();
>
> html.append( "href=\"javascript:showValues(" );
> html.append( imageMapArea.getValue() );
> html.append( ",'" );
> html.append( imageMapArea.getLengendLabel() );
> html.append( "','" );
> html.append( imageMapArea.getXAxisLabel() );
> html.append( "');\"" );
> %>
> <%= imageMapArea.toHTML( html.toString() ) %>
> <%
> //---reuse same StringBuffer Object
> html.delete( 0, html.length() );
> }
> %>
>
> produces something like:
>
> href="javascript:showValues(1500.0,'Bugs','1995');"
> href="javascript:showValues(6880.0,'Bugs','1996');"
> href="javascript:showValues(4510.0,'Bugs','1997');"
> href="javascript:showValues(2600.0,'Bugs','1998');"
> href="javascript:showValues(1200.0,'Bugs','1999');"
> href="javascript:showValues(1580.0,'Bugs','2000');"
> href="javascript:showValues(8000.0,'Bugs','2001');"
> href="javascript:showValues(4555.0,'Bugs','2002');"
> href="javascript:showValues(4000.0,'Bugs','2003');"
> href="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="rect" coords="20,20,60,60" href="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
>
>
>
=====
http://nathaniel-auvil.blog-city.com/
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
|