Sign in to follow this  
whitemedia

"&" In Caption

Recommended Posts

How can i get this code to work

 

$enkatname = 'Some text & some text'

$strXML = "<graph caption='".$enkatname."'.......

 

I get invalid XML Data

Edited by whitemedia

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

Welcome to FusionCharts Forum! smile.gif

You can directly embed most of the special characters and punctuation marks in the XML/JSON data source of your chart. However, &, <, >, ' (apostrophe) and "(quote) need to be specially encoded when providing the same as a part of the chart data. Apart from this, there is no need to encode any other special character.

For more details, please refer to the link:http://www.fusioncha...unctuation.html

Hope this helps.

Share this post


Link to post
Share on other sites

Hi,

 

Welcome to FusionCharts Forum! smile.gif

 

You can directly embed most of the special characters and punctuation marks in the XML/JSON data source of your chart. However, &, <, >, ' (apostrophe) and "(quote) need to be specially encoded when providing the same as a part of the chart data. Apart from this, there is no need to encode any other special character.

 

For more details, please refer to the link:http://www.fusioncha...unctuation.html

 

Hope this helps.

 

Thanx for reply but it still doesnt work. Must have something to do with how i print it with PHP.

 

$strXML = "<graph caption='".$enkatname."'.......

Share this post


Link to post
Share on other sites
Guest Angshu

Hi,

 

Could you please send us the entire code to look into the issue?

 

Awaiting for your response.

Share this post


Link to post
Share on other sites

Hi,

 

Could you please send us the entire code to look into the issue?

 

Awaiting for your response.

 

$enkatname is stored in a Mysql

 

$strXML = "<graph caption='".$enkatname."'

subcaption='".$start." - ".$end."'

yAxisMaxValue='6'

yAxisName=' '

numberPrefix=''

showNames='1'

showValues='1'

rotateNames='0'

labelDisplay='WRAP'

useEllipsesWhenOverflow='1'

showColumnShadow='1'

animation='1'

showAlternateHGridColor='1'

AlternateHGridColor='ff5904'

divLineColor='ff5904'

divLineAlpha='20'

alternateHGridAlpha='5'

canvasBorderColor='ffffff'

baseFontColor='222222'

lineThickness='3'

limitsDecimalPrecision='0'

divLineDecimalPrecision='0'

decimalPrecision='2'

bgColor='ffffff'

exportEnabled='1' exportAtClient='0' exportHandler='FusionCharts/FCExporter.php'

 

>

";

 

if ($f1 == ''){}else{$result = mysql_query("SELECT f1 FROM enkatsvar WHERE enkatid = $enkatid AND f1 != 0 AND date > '$start' AND date < '$endny'");

$num_rows = mysql_num_rows($result);

$res = mysql_query("SELECT sum( f1 ) as f1 FROM enkatsvar WHERE enkatid = $enkatid AND date > '$start' AND date < '$endny'");

$data = mysql_fetch_assoc( $res );

$total = $data['f1']; @(@($total2 = $total / $num_rows));

$strXML .= "<set name='$f1' value='$total2' />";}

 

 

$strXML .="</graph>";

 

echo '<table border="0">

<tr><td>'; //Create the chart - Column 3D Chart with data from Data/Data.xml

echo renderChartHTML("./FusionCharts/Column3D.swf", "", $strXML, "", 860, 420, false, true);

echo'</td><td valign="middle"><a title="" href="templates/viewenkat_fullscreen.php?enkatid='.$enkatid.'&start='.$start.'&end='.$end.'" rel="lyteframe" data-lyte-options="width:100% height:450 scrolling:no"><img src="./images/icons/full_screen.png" width="35"></td>

</tr>

</table>';

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