final Graphics2D graphics = image.createGraphics();
draw(graphics, bounds);
graphics.dispose();
}
final ImageMap map = new ImageMap();
final EntityCollection entityCollection = chartRenderingInfo.getEntityCollection();
final int count = entityCollection.getEntityCount();
for (int i = 0; i < count; i++)
{
final ChartEntity chartEntity = entityCollection.getEntity(i);
final Shape area = chartEntity.getArea();
final String hrefValue = chartEntity.getURLText();
final String tooltipValue = chartEntity.getToolTipText();
if (StringUtils.isEmpty(tooltipValue) == false ||
StringUtils.isEmpty(hrefValue) == false)
{
final AbstractImageMapEntry entry;
if (chartEntity instanceof XYItemEntity ||
chartEntity instanceof CategoryItemEntity ||
chartEntity instanceof PieSectionEntity)
{
entry = createMapEntry(area, dataArea);
}
else
{
entry = createMapEntry(area, otherArea);
}
if (entry == null)
{
continue;
}
if (StringUtils.isEmpty(hrefValue) == false)
{
entry.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "href", hrefValue);
}
else
{
entry.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "href", "#");
}
if (StringUtils.isEmpty(tooltipValue) == false)
{
entry.setAttribute(LibXmlInfo.XHTML_NAMESPACE, "title", tooltipValue);
}
map.addMapEntry(entry);
}
}
return map;
}