For example, in a pie chart, if the image map is generated using BaseChart.getHTMLImageMap with "piestub.php" as the handler, no matter which sector is clicked, the handler "piestub.php" is used. The different sectors are distinguished by different HTTP query parameters.
If for some reasons, it is desirable that different sectors use different handlers, the followings are some of the methods:
-
Produce the image map using BaseChart.getHTMLImageMap, with the same handler
for all sectors. In the handler, redirect the HTTP request to the "real handler"
based on the sector clicked. This is the simpliest and recommended method.
-
Use a client side Javascript function as the handler, where "{sector}" is
used as the argument to indicate which sector is clicked. For example,
"javascript:callMe({sector});" can be used as the handler. In the "callMe"
function, the client side Javascript can instruct the browser to load the "real
handler".
- Do not use BaseChart.getHTMLImageMap. Instead, use Sector.getImageCoor and Sector.getLabelCoor to obtain the image map coordinates of individual sectors and sector labels. With these coordinates, one can create custom <AREA> tags for the individual sectors and can put any attributes in them. One can therefore use different "href" attributes for different sectors.