Sign in to follow this  
rishi

Pie Chart Not Work If & Is Present In Label Or Value

Recommended Posts

Hi Guys,

 

I am using fusion pie chart with Extjs XTemplate. The problem is when the data ( label or value) contain & (ampersand) I get invalid xml data error. I tried to escape & by & but still facing the same issue.

 

Below is the HTML code generated if you'll see one of label have value Third& we have encode it to Third& .both Third& and Third& give invalid xml data error.

 

<embed src="../../CommonUI/dashboard/charts/Pie3D.swf" wmode="Transparent" scale="" value="exactfit" flashvars="&dataXML=<chart palette="4" decimals="3" animation="1" enableSmartLabels="1" enableRotation="1" bgColor="dbdee7,FFFFFF" showBorder="0" startingAngle="70"><set label="NA" value="57" isSliced="1" /><set label="Third&" value="6" isSliced="1" /><set label="Fourth" value="4" isSliced="1" /></chart>" quality="high" width="342" height="171" name="flashchartext-comp-1165-MIN" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">

 

Please help me.

 

Regards

Rishi Saraf

Share this post


Link to post
Share on other sites

Thanks a lot Sanjukta it worked smile.gif.

 

Out of curiosity I have one more question. Like & do we have more characters which are handled this way.

 

Regards

Rishi Saraf

 

Hi Rishi,

 

Welcome to FusionCharts Forum! :)

 

Could you please replace "&" with "%26"?

 

Hope this helps.

Share this post


Link to post
Share on other sites

Hi Sanjukta,

I found more problem that when we have both < and > character in word we again get issue even if we encode them with > , < however when we have any one of them i.e < or > they are displayed properly. Like in below code underlined text giving the issue.

<embed src="../../CommonUI/dashboard/charts/Pie3D.swf" wmode="Transparent" scale="" value="exactfit" flashvars="&dataXML=<chart palette="4" decimals="3" animation="1" enableSmartLabels="1" enableRotation="1" bgColor="dbdee7,FFFFFF" showBorder="0" startingAngle="70"><set label="NA" value="57" isSliced="1" /><set label="Third%26<>" value="6" isSliced="1" /><set label="Fourth" value="4" isSliced="1" /></chart>" quality="high" width="342" height="171" name="flashchartext-comp-1165-MIN" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">

Thanks a lot Sanjukta it worked smile.gif.

 

Out of curiosity I have one more question. Like & do we have more characters which are handled this way.

 

Regards

Rishi Saraf

 

 

Share this post


Link to post
Share on other sites

Hi Rishi,

 

You are always welcome. :)

 

Please refer to the following links to know further details on the usage of Multi-lingual/Special characters in FusionCharts.

http://www.fusioncharts.com/docs/?SpChar.html

http://www.fusioncharts.com/docs/?SpCharAll.html

http://www.fusioncharts.com/docs/?SpPunctuation.html

 

Also, the characters like "&", "<", ">", etc are invalid characters while mentioned in XML. In order to parse it perfectly we need to pass it in encoded format. The variables which are invalid in XML needs to be encoded.

 

Please check with the following link for your future reference. (As a suggestion :))

http://www.w3schools.com/tags/ref_urlencode.asp

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Hi Sanjukta,

 

Thanks for links. I know that & , < , > make the xml invalid that's why i tried to encode them by normal XML encoding code i.e & , < and &gt . I didn't knew that for fusion chart uses URL encoding.

 

Anyway Thanks again rolleyes.gif.

 

Regards

Rishi

 

Hi Rishi,

 

You are always welcome. :)

 

Please refer to the following links to know further details on the usage of Multi-lingual/Special characters in FusionCharts.

http://www.fusioncha...cs/?SpChar.html

http://www.fusioncha...?SpCharAll.html

http://www.fusioncha...unctuation.html

 

Also, the characters like "&", "<", ">", etc are invalid characters while mentioned in XML. In order to parse it perfectly we need to pass it in encoded format. The variables which are invalid in XML needs to be encoded.

 

Please check with the following link for your future reference. (As a suggestion :))

http://www.w3schools...f_urlencode.asp

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this