ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Overlapping ImageMap coordinates.
Posted by jaideep on Aug-02-2012 05:37
I am not sure if this has been addressed before, i tried doing a search in the forum threads, but did not find any related thread.

For Area or Line charts, the coordinates that the imagemap generates sometime overlaps by a little bit. This results in clicking on one area, but the action of the other area gets triggered. For eg -

<area  coords="578,310,578,339,591,339,603,339,603,308,591,298" shape="poly">
<area  coords="578,299,578,310,591,298,603,308,603,295,591,289" shape="poly">
<area  coords="578,288,578,299,591,289,603,295,603,283,591,278" shape="poly">
<area  coords="578,277,578,288,591,278,603,283,603,264,591,257" shape="poly">
<area  coords="578,259,578,277,591,257,603,264,603,228,591,236" shape="poly">
<area  coords="578,225,578,259,591,236,603,228,603,208,591,213" shape="poly">
<area  coords="578,212,578,225,591,213,603,208,603,197,591,199" shape="poly">
<area  coords="578,172,578,212,591,199,603,197,603,171,591,179" shape="poly">
<area  coords="578,105,578,172,591,179,603,171,603,149,591,157" shape="poly" >
<area  coords="553,324,553,339,565,339,578,339,578,309,565,321" shape="poly">
<area  coords="553,301,553,324,565,321,578,309,578,298,565,308" shape="poly">
<area  coords="553,291,553,301,565,308,578,298,578,288,565,298" shape="poly">
<area  coords="553,280,553,291,565,298,578,288,578,276,565,296" shape="poly">
<area  coords="553,261,553,280,565,296,578,276,578,258,565,281" shape="poly">
<area  coords="553,223,553,261,565,281,578,258,578,225,565,237" shape="poly">
<area  coords="553,202,553,223,565,237,578,225,578,212,565,225" shape="poly">
<area  coords="553,165,553,202,565,225,578,212,578,172,565,165" shape="poly" >
<area  coords="553,105,553,165,565,165,578,172,578,104,565,52" shape="poly" >


These are some of the nodes from a multi series area chart, and if you notice the coordinates overlap by a pixel. This does not happen in every case, but does at times.
Is there a way around it ?

thanks,
Jaideep.

  Re: Overlapping ImageMap coordinates.
Posted by Peter Kwan on Aug-02-2012 18:53
Hi jaideep,

It is normal that the image map coordinates can overlap a little bit. The overlapping usually occurs at the border between two hot spots. If someone clicks exact at the border, two hot spots would match, and the browser should choose the hot spot that comes first in the image map <area> tag list. As long as the browser only triggers one hot spot per click, it should be fine.

The reasons why the borders overlap are because the border can belong to either hot spot, and also because there is no standard on what exactly does the image map coordinates mean in defining the hot spots (different browsers or browser versions have different behaviour).

If we make the hot spots non-overlapping, we can just keep the border in the first <area> tag and subtract the border from the second <area> tag. The browser will have exactly the same behaviour as before (clicking the border will trigger the same hot spot as before), and nothing has really changed. So making the hot spots non-overlapping is not necessary.

On the other hand, overlapping hot spots are useful for browser compatibility. Imagine a border which is not a vertical or horizontal line, but is at an angle, such as from (0, 0) to (27, 16). In this case, although the end points are at integer coordinates, the points in the middle of the line can be at fractional coordinates, and it is not clear if the hot spot should include these fractional pixels. (The mouse can only click on integer pixels.) Different browsers or browser versions have different behaviour. By overlapping the border, we can ensure the fractional pixels at the border are at least included in one of the hot spot.

Regards
Peter Kwan