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

Message ListMessage List     Post MessagePost Message

  Differences between getHTMLImageMap from versions 5.02 and 5.1
Posted by Miguel ?ngel on Jun-12-2012 19:57
Hello,

I'm working in a graph with more than one data per pixel. Actually, with version ChartDirector 5.02, the function getHTMLImageMap returns areas of maximum width 1 pixel.
However, after install verion 5.1, the same function returns areas of more than 4 or 5 pixels.
Why this difference?
I tried to use de function setFastLineMode without better results. Somo clue?

Best regards,
Miguel Angel

  Re: Differences between getHTMLImageMap from versions 5.02 and 5.1
Posted by Peter Kwan on Jun-13-2012 02:33
Hi Miguel,

The image map for a line layer is always supposed to be as thick as a 10-pixels thick line (configurable using LineLayer.setImageMapWidth). However, as the image map is intended to be used for mouse interactions (such as mouse hover tooltips), ChartDirector does not accurately trace out the 10-pixels thick line but use many approximations. This should not affect mouse interaction usages. As long as the mouse is reasonable close to the line, it should pop up the tooltip.

In ChartDirector Ver 5.1, the line image map more accurately reflects a 10-pixels thick line if the line segment length (distance between two points) are greater than 10-pixels. If the line segment is very short, the image map for the segment will be simplified to become a 10-pixels wide square that encloses the line segment.

ChartDirector Ver 5.1 also uses an algorithm to remove overlapping image maps, so the resulting image map may not contain all data points. This should not affect mouse interactions, because the overlapped image map, being blocked by the image map above it, cannot actually response to mouse events.

For your case, are you using the image for the purpose of mouse interactions, or are you trying to extract the coordinates of the line segments from the image map for other purposes?

If you would like to have an image map of around 1 pixel thick, you may use LineLayer.setImageMapWidth to configure such a thin image map. However, it would be rather difficult for the mouse to be position above such a small region.

There are other methods of produce an image map of other dimensions (eg. a 2 x 10 pixels region) around the data points. One method is to use a transparent scatter layer, with a rectangular data symbol the size of the image map you want.

Hope this can help.

Regards
Peter Kwan

  Re: Differences between getHTMLImageMap from versions 5.02 and 5.1
Posted by Miguel ?ngel on Jun-13-2012 16:57
Hello Peter,

I'm trying to extract the coordinates of the line segments from the image map to make a tooltip more sofisticated with jQuery.

It would be great if we could get data of start and end of segments in other formats such as JSON instead of having to extract it from the map area string.

However, the setImageMapWidth did work although I had to use 0 as parameter.
Thanks for all.

Best regards,
Miguel Angel

  Re: Differences between getHTMLImageMap from versions 5.02 and 5.1
Posted by Miguel ?ngel on Jun-13-2012 17:55
Hello,

Finally setImageMapWidth didn't work, because with 0 as parameter always returns segments of 1 pixel width. I believe than I'll come back to version 5.02.

Regards,
Miguel Angel

  Re: Differences between getHTMLImageMap from versions 5.02 and 5.1
Posted by Peter Kwan on Jun-13-2012 23:46
Hi Miguel,

The image map is only designed to handle mouse interactions. It should not be used to deduce the coordinates of the line segments. ChartDirector may use many optimizations to try to reduce the size of the image map, such as changing the hot spot shape, eliminating some points, etc.. The optimizations may change for different versions of ChartDirector.

To obtain accurate coordinates of the data points, it is suggested you use XYChart.getXCoor / XYChart.getYCoor or Layer.getXCoor / Layer.getYCoor. You can easily create a JSON structure with these coordinates.

Regards
Peter Kwan