|
click label link & getHTMLImageMap |
Posted by Lou on Aug-12-2009 03:54 |
|
I am trying to make the label on the bar graph clickable to redirect the user to a different page. The bar graph direct the user to page 1 and the clickable labels should direct the user to page2, but the labels is not working properly.
The clickable labels is redirecting the user to a different page but the values in the url field contains some unicode characters which the recieving page can't understand.
For iLoop = LBound(tLabels1) To UBound(tLabels1)
//this is for the clickable labels
aCompImageMap(iLoop) = "dest.asp?App=" & HTMLEncode("xComp/ " & tLabels1(iLoop) & " /Planning")& "&Catid=" & catid & "&CmpLabel="& CmpLabel D & "&appType="&tLabels1(iLoop) & ""
Next
c.addExtraField(aCompImageMap)
//this line below is for the bar graph
ImageMap = c.getHTMLImageMap("dest.asp?App=" & URLEncode("xComp/ ") & "&Catid=" & catid & "&guid={Field0}"& "&AppId=" & AppId, "", "") + AllComponents
ImageMap = ImageMap & c.xAxis().getHTMLImageMap("{field1}")
The urls address displays the following line when the label is clicked:
/list.asp%3FApplication%3DPACS%20Components/%20Workstations%20/Planned%20%26amp;%20Purchased
- I noticed the 3F, 3D, and the "+" is replaced with "%20". Is there a simply way to convert it back to it's intend value?
I posted a message earlier regarding the clickable link but I decided to go a different way. I thought this might be more earlier to execute and maintain.
thanks for the helpful hint earlier. |
Re: click label link & getHTMLImageMap |
Posted by Peter Kwan on Aug-12-2009 16:55 |
|
Hi Lou,
By default, ChartDirector will assume a template field {xxx} (eg. {field1}) to be a kind of arbitrary data.
Certain characters are reserved or illegal in HTML/URL. So when {xxx} is used in HTML, ChartDirector will escape it using the standard HTML sequence. If the {xxx} is used as part of a URL (in the first or second parameter to getHTMLImageMap), ChartDirector in addition will escape it using the URL escape sequence.
However, if your extra field is actually something that you have already escaped yourself, you may ask ChartDirector not to escape the characters. The code is:
'disable both HTML and URL escape sequence
ImageMap = ImageMap & c.xAxis().getHTMLImageMap("{noescape_url}{noescape_html}{field1}")
Hope this can help.
Regards
Peter Kwan |
|