I am mixing plots with tooltips and without tooltips.
In order to avoid conflicts and to ligthen the page, I patched the code to avoid area generation without any tooltip or url :
In ChartEntity I modified getImageMapAreaTag :
/**
* Returns an HTML image map tag tag for this entity
* only if a tooltip or an url is present.
*
* @param useOverLibForToolTips Whether to use OverLIB for tooltips
* (http://www.bosrup.com/web/overlib/).
*
* @return The HTML tag
*/
public String getImageMapAreaTag(boolean useOverLibForToolTips) {
StringBuffer tag = new StringBuffer();
if ((this.urlText == null ? false : !this.urlText.equals(""))
|| (this.toolTipText == null ? false : !this.toolTipText.equals(""))) {
tag.append( "<AREA SHAPE=\"" + getShapeType() + "\""
+ " COORDS=\"" + getShapeCoords() + "\"");
if (this.urlText == null ? false : !this.urlText.equals("")) {
tag.append( " href=\"" + this.urlText + "\"");
}
if (this.toolTipText == null ? false : !this.toolTipText.equals("")) {
if (useOverLibForToolTips) {
tag.append( " onmouseover=\"return overlib('" + this.toolTipText
+ "');\" onmouseout=\"return nd();\"");
}
else {
tag.append(" title=\"" + this.toolTipText + "\"");
}
}
tag.append( ">");
}
return tag.toString();
}
and in ChartUtilities I modified writeImageMap :
public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info,
boolean useOverLibForToolTips) throws IOException {
writer.println("<MAP NAME=\"" + name + "\">");
EntityCollection entities = info.getEntityCollection();
Iterator iterator = entities.iterator();
while (iterator.hasNext()) {
ChartEntity entity = (ChartEntity) iterator.next();
String area = entity.getImageMapAreaTag(useOverLibForToolTips);
if (area.length()>0)
writer.println(area);
}
writer.println("</MAP>");
}
Hoping, you will find this patch useful.
You can contact me if you want the patch in another format.
Xavier Poinsard.
small patch for map area generation
Re: small patch for map area generation
Hi Xavier,
Thanks for the patch, it sounds like a pretty sensible idea. I'll incorporate it for the next release...
Regards,
DG
Thanks for the patch, it sounds like a pretty sensible idea. I'll incorporate it for the next release...
Regards,
DG
Re: small patch for map area generation
It seems you forgot to include the patch.
Doesn't it ?
Doesn't it ?
Re: small patch for map area generation
Hi Xavier,
Sorry, another thing I have missed! I've added it to the Feature Request database on SourceForge (id=688079) so it won't get lost.
Regards,
Dave Gilbert
Sorry, another thing I have missed! I've added it to the Feature Request database on SourceForge (id=688079) so it won't get lost.
Regards,
Dave Gilbert