File "Adv_delim.html"
Full Path: /home/analogde/www/PC-20260403043447/PHPClassAPI/Adv_delim.html
File size: 4.85 KB
MIME-type: text/xml
Charset: utf-8
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>FusionCharts Free Documentation</title>
<link rel="stylesheet" type="text/css" href="../Style.css">
</head>
<body>
<table width="98%" border="0" cellspacing="0" cellpadding="3" align="center">
<tr>
<td><h2 class="pageHeader">FusionCharts PHP Class API > Advanced Usage > Setting Delimiter </h2></td>
</tr>
<tr>
<td valign="top" class="text">Delimiter is the character used to separate two consecutive attributes within the chart attribute list. FusionCharts uses semicolon (;) as the default delimiter. To replace the default delimiter with a new character, simply call <span class="codeInline">setParamDelimiter()</span> function and pass the new delimiter character though it as shown in the code below: </td>
</tr>
<tr>
<td valign="top" class="text"> </td>
</tr>
<tr>
<td valign="top" class="codeInline"><strong>$FC->setParamDelimiter("$");</strong></td>
</tr>
<tr>
<td valign="top" class="text"> </td>
</tr>
<tr>
<td valign="top" class="text">Now you can use <strong>'$'</strong> as delimiter in the following statements of your program: </td>
</tr>
<tr>
<td valign="top" class="text"> </td>
</tr>
<tr>
<td valign="top" class="codeInline">$strParam="bgColor=CC66CC<strong>$</strong>canvasBgColor=BC6699<strong>$</strong>showBorder=1<strong>$</strong>borderColor=00FF00";</td>
</tr>
<tr>
<td valign="top" class="text"> </td>
</tr>
<tr>
<td valign="top" class="text">Consider the code below: </td>
</tr>
<tr>
<td valign="top" class="codeBlock"><p><?php</p>
<p><span class="codeComment"># Include FusionCharts PHP Class</span><br />
include('class/FusionCharts_Gen.php');</p>
<p><span class="codeComment"># Create FusionCharts PHP object</span><br />
$FC = new FusionCharts("MSColumn3DLineDY","350","300"); <br />
<span class="codeComment"># set the relative path of the swf file</span><br />
$FC->setSWFPath("FusionCharts/");</p>
<p><span class="codeComment"># Set chart attributes</span><br />
$strParam="caption=Weekly Sales;subcaption=Comparison;xAxisName=Week; pYAxisName=Revenue;sYAxisName=Total Quantity;decimalPrecision=0;";<br />
<span class="codeComment"><strong># Note that we have used semicolon (;) as the delimiter here </strong></span></p>
<p>$FC->setChartParams($strParam);</p>
<p>...<br />
...</p>
<p><span class="codeComment"><strong># Set colon (:) as delimiter</strong></span><br />
<strong>$FC->setParamDelimiter(":");</strong></p>
<p><span class="codeComment"># Add a new dataset with dataset parameters </span><br />
$FC->addDataset("This Month","<strong>numberPrefix=$:showValues=0");</strong> <br />
<span class="codeComment"><strong># Please note that in the above line colon (:) has been used to separate consecutive attributes </strong></span><br />
<span class="codeComment"># Add chart data for the above dataset</span><br />
$FC->addChartData("40800");<br />
$FC->addChartData("31400");<br />
$FC->addChartData("26700");<br />
$FC->addChartData("54400");</p>
<p><span class="codeComment"><strong># Set hash (#) as delimiter</strong></span><strong><br />
$FC->setParamDelimiter("#")</strong>;</p>
<p><span class="codeComment"># Add aother dataset with dataset parameters </span><br />
$FC->addDataset("Previous Month","<strong>numberPrefix=$#showValues=0"); <br />
<span class="codeComment"># Please note that in the above line hash (#) has been used as delimiter) </span></strong><span class="codeComment"><br />
# Add chart data for the second dataset</span><br />
$FC->addChartData("38300");<br />
$FC->addChartData("28400");<br />
$FC->addChartData("15700");<br />
$FC->addChartData("48100");</p>
<p>...<br />
...</p>
<p><?<br />
<span class="codeComment"># Render Chart</span><br />
$FC->renderChart();</p>
<p>?><br />
</body><br />
</html></p>
<p></p></td>
</tr>
<tr>
<td valign="top" class="text">The code shows that we can use different delimiters in our programs provided the delimiter is declared before using. </td>
</tr>
</table>
</body>
</html>