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

Message ListMessage List     Post MessagePost Message

  No image map in chrome and safari
Posted by jcagumbay on Jun-11-2010 18:27
Hi, I have a chart which should be clickable. Its doing fine in Firefox and IE, it shows the title of the mapped area but not in Chrome and Safari. Any ideas about it? Thank you.

  Re: No image map in chrome and safari
Posted by Peter Kwan on Jun-12-2010 03:27
Hi jacgumbay,

Is it possible to provide a sample to me? Without the sample, it is hard to know what is the cause of the problem.

For testing, please try to simply the code to provide a test case. If you are using Javascript and CSS, etc, please remove all of them, so that you just have a plain basic HTML with just the image. If the tooltip works, then the issue could be related to the HTML (there are thousands of browser bugs), or the Javascript (especially some "framework" type of Javascript that will scan the whole web page and modifies it), or the CSS. You may need to slowly add these features back to see which part is related to the problem.

If the tooltips do not appear even with the simplified test case, please use FireFox to save the complete web page. FireFox should create a ".htm" file and also a directory containing all the dependencies (the image). Please zip the whole thing and attach it in your image, or email to me at pkwan@advsofteng.net. This would help to diagnose the problem.

Regards
Peter Kwan

  Re: No image map in chrome and safari
Posted by Martin Lefebvre on Jun-27-2011 22:57
Hi Peter,

Sorry to dig out a really old post, but this problem is still causing me headaches today. My users are constantly complaining of not being able to click on the area map attached to a graph generated with ChartDirector.

In your reply, which I quoted below, you asked the OP to provide an example of a test case where this issue happens. I was looking through the differences in the code generated under both Firefox and Chrome, and noticed this:

Chrome creates the image map tag as <map id="map_chart"></map>
Firefox creates the image map tag as <map id="map_chart" name="map_chart"></map>

So I added the 'name="map_chart"' attribute to the <map> tag using Chrome's element inspector, and I was able to click on the chart!

Now I'm trying to figure out how to add the name attribute to the charts... unfortunately there's a lot of PHP ChartDirector code to look at... if it's even there and not in the library files...

Hope this helps

Peter Kwan wrote:

Hi jacgumbay,

Is it possible to provide a sample to me? Without the sample, it is hard to know what is the cause of the problem.

For testing, please try to simply the code to provide a test case. If you are using Javascript and CSS, etc, please remove all of them, so that you just have a plain basic HTML with just the image. If the tooltip works, then the issue could be related to the HTML (there are thousands of browser bugs), or the Javascript (especially some "framework" type of Javascript that will scan the whole web page and modifies it), or the CSS. You may need to slowly add these features back to see which part is related to the problem.

If the tooltips do not appear even with the simplified test case, please use FireFox to save the complete web page. FireFox should create a ".htm" file and also a directory containing all the dependencies (the image). Please zip the whole thing and attach it in your image, or email to me at pkwan@advsofteng.net. This would help to diagnose the problem.

Regards
Peter Kwan

  Re: No image map in chrome and safari
Posted by Martin Lefebvre on Jun-27-2011 23:23
Actually, after doing a quick grep through all of the PHP ChartDirector files, I found what I was looking for in cdjcv.js.

On line 217, I changed:

d.body.insertAdjacentHTML("BeforeEnd","<MAP ID='"+la3+"'></MAP>"); to

d.body.insertAdjacentHTML("BeforeEnd","<MAP NAME='"+la3+"' ID='"+la3+"'></MAP>");

Now my image maps are working in Chrome!!!

  Re: No image map in chrome and safari
Posted by Peter Kwan on Jun-28-2011 01:58
Hi Martin,

Thanks a lot for informing us of the solution. This is in fact a bug in ChartDirector.

We can only reproduce it if the chart initially has no image map, but subsequently obtain an image map through AJAX means. In this case, the Javascript code needs to create a new MAP tag, but it leaves out the NAME attribute, causing the issue.

I will make sure the fix be incorporated in the next version of ChartDirector.

Again, thanks a lot for reporting this issue to us and informing us of the solution.

Regards
Peter Kwan