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

Message ListMessage List     Post MessagePost Message

  tooltip display errors
Posted by Rob on Mar-19-2009 06:13
Hello,
I am having an issue with displaying strings to my tooltips in the PHP chartdirector program. I am pulling labels for my nodes of a 'varchar' type froma  mysql database.

//
$tool_data[$f]=$cc_name."-".$date.":".$var[$d-1].":::".$comments[$d-1];

$tool_data is an array that holds my string which i pass as an extra field

$layer->addExtraField($tool_data);

then display with

$toolTip = "title='{field0}'";

The problem I have is $comments, with is the only part of the string to contain non-numerical elemements has '%' signs inserted wherever there was a whitespace
('hello world' becomes 'hello%world') in the original string. I was hoping you might understand why I was getting this error. I also tried using the php trim($comments[$d-1],"%"). Thanks.

  Re: tooltip display errors
Posted by Peter Kwan on Mar-19-2009 14:44
Hi Rob,

I think the most likely reason that there are "%" in the tooltips is because there are "%" in your comments.

You may try the following code:

$c->addTitle($tool_data[0]);

Now you can see the first tooltip in the chart title. (Comment out the code for your existing chart title if any.) You may then verify if it is the same as the tooltip that pops up in the first element.

If the above still cannot solve the problem, is it possible to save the web output (use IE File/Save As, and save the entire output as a "Web Archive"), and attach the output, or email it to me (pkwan@advsofteng.net)? I will analysis the AREA tags in the HTML and the chart image (with the first tooltip in the title) to try to determine the cause of the problem.

Regards
Peter Kwan

  Re: tooltip display errors
Posted by Rob on Mar-20-2009 21:46
Attachments:
Hello,
I used c->setTitle to dipslay what is being outputted to the tooltips. It displayed correctly in the Title, there wasn't any percent signs at at all. I have saved the webs site as you recommended and hopefully you can see what the issue is. Thank you.

Error
Sting
'This is a test' -> 'this%20is%20a%20test%20' in tooltips
chart_display_options.htm

  Re: tooltip display errors
Posted by Peter Kwan on Mar-21-2009 03:28
Hi Rob,

If the space is replaced by "%20" (instead of just a "%" sign), it seems the text is treated as part of a URL text string. In URL, a space must be changed to %20 as per URL standard.

From the output of your HTML, it seems the <area> tags are ill-formed. Are you passing the tooltips as the first argument to getHTMLImageMap (which is for the URL), instead of the third argument to getHTMLImageMap (which is for HTML attributes)?

If the above still does not solve the problem, would you mind to inform me of the charting part of your code (at least include the part that generates the image map)?

Hope this can help.

Regards
Peter Kwan

  Re: tooltip display errors
Posted by Rob on Mar-24-2009 00:02
Thanks switching the parameter I passed my sting in the imagemap solved the issue.

Regards,