10.3. Specifying targets for image map plots

To turn a standard image script into a CSIM script the first thing needed to do is to supply the appropriate URL targets for the hotspots in the image. What the hotspots represent depends on the type of plot. CSIM is supported by all graph types.

To specify a URI link for each hotspot the SetCSIMTargets() method is used on the graph object that should be given a hotspot.

There are two arguments to this method

  1. $aTargets, an array of valid URL targets. One URL per hot spot, for example if you have a 10 values bar plot you need 10 URLs. If the SetCSIMTarget() is applied to, for example, a text then only one URL target should be specified.

  2. $aAlts, an array of valid alt-texts. Many browsers (but not all) will show this text string if the mouse hovers over a hotspot.

10.3.1. Creating popup-windows as targets for CSIM

URL targets specified will be opened by the browser as usual, i.e. it will replace the current HTML page. Another common usage pattern is to opena popup window, perhaps with a zoomed version of a graph. This can be done by adding some javascript in the target URL. If the URL, for example, is specified as

$target = "..."; 
$targetURL = "javascript:window.open('$target?id=%d','_new','width=500,height=300');void(0)"

clicking on a target will now open a separate window with the specified width and height. The $target variable must be set to the wanted URL.