|
Line Chart -> getHTMLImageMap not working on IE |
Posted by MuchJokes on Oct-12-2011 00:13 |
|
Here's what I've got going on. This chunk gets called after the chart is made and, when looking at the result, actually creates map and area tags of correct format.
$imageMap = "";
reset($this->independents);
$xAxis = current($this->independents)->getUnits();
$pointAlt = "$xAxis: {xLabel}; {dsField0}: {value}";
$pointTitle = htmlentities("<table><tr><td>$xAxis</td><td>{xLabel}</td></tr><tr><td>{dsField0}</td><td>{value}</td></tr></table>");
$imageMap .= "\\n<map name=\\"chartMap\\" id=\\"chartMap\\">\\n";
$imageMap .= $this->chart->getHTMLImageMap("", "", "nohref=\\"nohref\\" id=\\"chartPoint{layerId}_{dataSet}_{x}\\" title=\\"$pointTitle\\" alt=\\"$pointAlt\\" /");
$imageMap .= "</map>\\n";
In firefox, what happens next is that a tooltip shows up. I thought the tooltip was doing something wrong but removing it makes no difference. In IE, the default title attribute tooltip just doesn't show up. In fact, I don't think IE can even find the location of the area.
I copied the output of getHTMLImageMap, one of the area tags, and manually pasted it into the code and voila! It works!
$imageMap .= "\\n<map name=\\"chartMap\\" id=\\"chartMap\\">\\n";
$imageMap .= '<area id="chartPoint0_0_2" alt="Month: Mar; Mean Maximum Temperature (?C): 3.7" title="<table><tr><td>Month</td><td>Mar</td></tr><tr><td>Mean Maximum Temperature (?C)</td><td>3.7</td></tr></table>" nohref="nohref" coords="142,158,172,86,182,86,152,158" shape="poly">';
$imageMap .= "</map>\\n";
Then it works! IE can find that coordinate and display the title just fine (or the tooltip, it worked both ways).
I am no longer in control of this code. |
Re: Line Chart -> getHTMLImageMap not working on IE |
Posted by Peter Kwan on Oct-12-2011 02:58 |
|
Hi MuchJokes,
For the behaviour you see, it is possible the image map is ill-formed in HTML syntax. For example, if one of the image map lines is ill-formed, it may cause the </map> tag to be missed entirely by the browser, and therefore causing the entire image map not to work.
To diagnose the problem, would you mind to inform me the output of the web page as received by your browser (you may use IE, choose Files/Save As, and save as a web archive). I can then examine the HTML output to see where is the issue. This can help to determine what is the cause of the problem.
Regards
Peter Kwan |
Re: Line Chart -> getHTMLImageMap not working on IE |
Posted by MuchJokes on Oct-12-2011 04:00 |
|
I'm not really sure how this sending files thing works on this form, but I've attached and possibly sent both the version with the tooltip enabled (which actually strips away the title attribute), and one with the tooltip disabled once I remembered about the title attribute stripping.
Neither work. |
Re: Line Chart -> getHTMLImageMap not working on IE |
Posted by Peter Kwan on Oct-12-2011 17:38 |
|
Hi MuchJokes.
For some reasons, I cannot see any attachment in your message. May be you can email it directly to me. My email is pkwan@advsofteng.net.
Regards
Peter Kwan |
Re: Line Chart -> getHTMLImageMap not working on IE |
Posted by MuchJokes on Oct-13-2011 21:10 |
|
Thanks for the help, Peter.
Turns out there was a function created specifically for displaying the chart in IE without using the MakeChart function (because they wished it to be embedded in an img tag before being printed).
I added a MakeChart and it seems to work now.
Thanks again,
MuchJokes |
|