ChartDirector Ver 4.1 (PHP Edition Edition)

Making Other Objects Clickable

Note that ChartDirector image map support is "open-ended". You can always insert additional <AREA> tags inside the image map.
In general, if an object contains multiple hot spots (e.g. the bars in a bar chart), the "getHTMLImageMap" method of that object may be used to generate <AREA> tags for all hot spots at once. These <AREA> tags will use the same handler and the hot spots will be distinguished by query parameters.
On the other hand, if an object only has one hot spot (e.g. a single sector or a text box), it is more convenient to enter the handler and tool tip attributes directly into the <AREA> tag. In this case, the "getImageCoor" method of that object may be used for getting the image map coordinates of the hot spot.
In case an object has no "getHTMLImageMap" or "getImageCoor" method, it may be necessary to compute or estimate its coordinates to create the <AREA> tag.
For example, suppose you want the vertical y-axis of an XYChart to be clickable. The end points of the y-axis are known. They are just the corners of the plot area. The "width" of the y-axis may be unknown, but for clickable purposes, it may be acceptable to assume a reasonable width. In this way, the coordinates of the bounding rectangle of the y-axis can be determined.
If the (x, y) coordinates of an object is only known by their data values, you can convert them to pixel coordinates using Layer.getXCoor and Layer.getYCoor (or PolarChart.getXCoor and PolarChart.getYCoor for polar charts).

© 2006 Advanced Software Engineering Limited. All rights reserved.