PageRenderTime 72ms CodeModel.GetById 30ms RepoModel.GetById 1ms app.codeStats 0ms

/app/protected/extensions/fusioncharts/FusionChartMaker.php

https://bitbucket.org/ferhatelmas/zurmo
PHP | 2136 lines | 1699 code | 201 blank | 236 comment | 94 complexity | 91bcac6eb6f287e0938da7de419d81af MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, BSD-2-Clause, GPL-3.0, BSD-3-Clause

Large files files are truncated, but you can click here to view the full file

  1. <?php
  2. class FusionChartMaker
  3. {
  4. var $chartType; # Chart Friendly Name
  5. var $chartID; # ID of the Chart for JS interactivity(optional)
  6. var $SWFFile; # Name of the required FusionCharts SWF file
  7. var $SWFPath; # relative path of FusionCharts SWF files
  8. var $width; # FusionCharts width
  9. var $height; # FusionCharts height
  10. # attribute Delimiter
  11. var $del;
  12. # Chart XML string
  13. var $strXML;
  14. # Chart Series Types : 1 => single series, 2=> multi-series, 5=>Gantt (
  15. # For Future Use : 3=> scatter and bubble, 4=> MSStacked
  16. var $seriesType;
  17. # Charts Atribute array
  18. var $chartParams = array(); #List of Chart Parameters
  19. var $chartParamsCounter; #Number of Chart parameters
  20. var $categoriesParam; # Categories Parameter Setting
  21. var $categoryNames = array(); # Category array for storing Category set
  22. var $categoryNamesCounter; # Category array counter
  23. var $dataset = array(); # dataset array
  24. var $datasetParam = array(); # dataset parameter setting array
  25. var $datasetCounter; # dataset array counter
  26. var $setCounter; # set array counter
  27. # trendLines array
  28. var $trendLines = array(); # trendLines array
  29. var $tLineCounter; # trendLines array counter
  30. #chart messages
  31. var $chartMSG;
  32. var $chartSWF = array(); # Charts SWF array
  33. var $arr_FCColors = array(); # Color Set to be applied to dataplots
  34. var $UserColorON; # User define color define true or false
  35. var $userColorCounter;
  36. // Cache Control
  37. var $noCache;
  38. var $DataBaseType; # DataBase Type
  39. var $encodeChars; # XML for dataXML or dataURL
  40. #############============ For Gantt Chart ============================
  41. # Gantt categories
  42. var $GT_categories = array();
  43. var $GT_categories_Counter;
  44. var $GT_categoriesParam = array();
  45. var $GT_subcategories_Counter;
  46. # Gantt processes
  47. var $GT_processes = array();
  48. var $GT_processes_Counter;
  49. var $GT_processes_Param;
  50. # Gantt Tasks
  51. var $GT_Tasks = array();
  52. var $GT_Tasks_Counter;
  53. var $GT_Tasks_Param;
  54. # Gantt Connectors
  55. var $GT_Connectors = array();
  56. var $GT_Connectors_Counter;
  57. var $GT_Connectors_Param;
  58. # Gantt Milestones
  59. var $GT_Milestones = array();
  60. var $GT_Milestones_Counter;
  61. var $GT_Milestones_Param;
  62. # Gantt datatable
  63. var $GT_datatable = array();
  64. var $GT_datatable_Counter;
  65. var $GT_datatableParam;
  66. var $GT_dataColumnParam = array();
  67. var $GT_subdatatable_Counter;
  68. #------- For Futute Use (start)----------------
  69. # Gantt legend
  70. var $GT_legend = array();
  71. var $GT_legend_Counter;
  72. var $GT_legend_Param;
  73. #------- For Futute Use (end)----------------
  74. var $wMode;
  75. # Advanced Chart settings
  76. var $JSC = array();
  77. #############============ For Future Use (start)============================
  78. # dataset for MSStackedColumn2D
  79. var $MSSDataset = array(); # dataset array for MSStackedColumn2D
  80. var $MSSDatasetParams = array(); # MSSDataset parameter setting
  81. var $MSSDatasetCounter; # MSSDataset array counter
  82. var $MSSSubDatasetCounter; # ms sub dataset array counter
  83. var $MSSSetCounter; # msset array counter
  84. # lineset
  85. var $lineSet = array(); # lineSet array
  86. var $lineSetParam = array(); # lineSet Parameter setting array
  87. var $lineCounter; # line array counter
  88. var $lineSetCounter; # lineset array counter
  89. var $lineIDCounter; # lineID counter;
  90. # vtrendLines array
  91. var $vtrendLines = array(); # vtrendLines array
  92. var $vtLineCounter; # vtrendLines array counter
  93. # style array
  94. var $styles = array(); # styles array
  95. var $styleDefCounter; # define counter
  96. var $styleAppCounter; # apply counter
  97. #############============ For Future Use (end)============================
  98. # FusionCharts Constructor, its take 4 Parameters.
  99. # when we create object of FusionCharts, then Constructor will auto run and initialize
  100. # chats array parameter like chartType, width, height, chartsID
  101. function FusionChartMaker($chartType="column2d",$width="400",$height="300",$chartID="",$isTransparent=""){
  102. $this->wMode=$isTransparent;
  103. # Setting All Charts Array
  104. $this->setChartArrays();
  105. #initialise colorList
  106. $this->colorInit();
  107. # Setting Chart name
  108. $this->chartType=strtolower($chartType);
  109. # Getting Charts Series Type
  110. $this->getSeriesType();
  111. # Setting Charts Width and Height
  112. $this->width=$width;
  113. $this->height=$height;
  114. # Setting ChartID, Defult is Charts Name
  115. if ($chartID==""){
  116. $chartCounter=@$_SESSION['chartcount'];
  117. if($chartCounter<=0 || $chartCounter==null){
  118. $chartCounter=1;
  119. }
  120. $this->chartID=$chartType . $chartCounter;
  121. $_SESSION['chartcount']=++$chartCounter;
  122. }else{
  123. $this->chartID=$chartID;
  124. }
  125. # Setting Defult Parameter Delimiter to ';'
  126. $this->del=";";
  127. # Setting Default SWF Path
  128. $this->SWFPath="";
  129. $this->SWFFile=$this->SWFPath . "FCF_" . $this->chartSWF[$this->chartType][0] . ".swf";
  130. # Initialize categoriesParam
  131. $this->categoriesParam="";
  132. $this->categoryNamesCounter=1;
  133. # Creating Category Array
  134. $this->createCategory($this->categoryNamesCounter);
  135. # Initialize Dataset Variables
  136. $this->datasetCounter=0;
  137. $this->setCounter= 0;
  138. if($this->seriesType>1){
  139. $this->setCounter++;
  140. }
  141. # Initialize MSSDataset Variables
  142. if($this->seriesType==4){
  143. $this->MSSDatasetCounter=0;
  144. $this->MSSSubDatasetCounter=0;
  145. $this->MSSSetCounter=0;
  146. $this->lineCounter=0;
  147. $this->lineSetCounter=0;
  148. $this->lineIDCounter=0;
  149. }
  150. # vTrendLines Array inisialize
  151. if($this->seriesType==3){
  152. $this->vtLineCounter=1;
  153. $this->createvTrendLines($this->vtLineCounter);
  154. }
  155. # TrendLines Array inisialize
  156. $this->tLineCounter=1;
  157. $this->createTrendLines($this->tLineCounter);
  158. # Styles Array inisialize
  159. $this->styleDefCounter=1;
  160. $this->styleAppCounter=1;
  161. $this->createStyles("definition");
  162. $this->createSubStyles("definition","style");
  163. $this->createSubStylesParam("definition","style",$this->styleDefCounter);
  164. $this->GT_categories_Counter=0;
  165. $this->GT_subcategories_Counter=0;
  166. $this->GT_processes_Counter=0;
  167. $this->GT_processes_Param="";
  168. $this->GT_Tasks_Counter=0;
  169. $this->GT_Tasks_Param="";
  170. # Gantt Connectors
  171. $this->GT_Connectors_Counter=0;
  172. $this->GT_Connectors_Param="";
  173. # Gantt datatable
  174. $this->GT_datatable_Counter=0;
  175. $this->GT_datatableParam="";
  176. $this->GT_subdatatable_Counter=0;
  177. # Gantt legend
  178. $this->GT_legend_Counter=0;
  179. $this->GT_legend_Param="";
  180. $this->chartMSG="";
  181. # XML store Variables
  182. $this->strXML="";
  183. $this->UserColorON = false;
  184. $this->userColorCounter=0;
  185. $this->noCache=false;
  186. $this->DataBaseType="mysql";
  187. // JS Constructor
  188. $this->JSC["debugmode"]=false; # debugmode default is false
  189. $this->JSC["registerwithjs"]=false; # registerwithJS default is false
  190. $this->JSC["bgcolor"]=""; # bgcolor default not set
  191. $this->JSC["scalemode"]="noScale"; # scalemode default noScale
  192. $this->JSC["lang"]="EN"; # Language default EN
  193. // dataXML type encode
  194. $this->encodeChars=true;
  195. }
  196. ##------------ PUBLIC FUNCTIONS ----------------------------------------------------------------
  197. # Special Character
  198. function encodeXMLChars($option=true){
  199. $this->$encodeChars=$option;
  200. }
  201. # Setting Parameter Delimiter, Defult Parameter Separator is ";"
  202. function setParamDelimiter($strDel){
  203. $this->del=$strDel;
  204. }
  205. # Database type set like ORACLE and MYSQL
  206. function setDataBaseType($dbType){
  207. $this->DataBaseType=strtolower($dbType);
  208. }
  209. # Setting path of SWF file. file name like FCF_Column3D.swf. where FCF_ is common for all SWF file
  210. function setSWFPath($SWFPath){
  211. $this->SWFPath=$SWFPath;
  212. $this->SWFFile=$this->SWFPath . "FCF_" . $this->chartSWF[$this->chartType][0] . ".swf";
  213. }
  214. # We can add or change single Chart parameter by setChartParam function
  215. # its take Parameter Name and its Value
  216. function setChartParam($paramName, $paramValue){
  217. $this->chartParams[$paramName]=$this->encodeSpecialChars($paramValue);
  218. }
  219. # We can add or change Chart parameter sets by setChartParams function
  220. # its take parameterset [ caption=xyz caption;subCaption=abcd abcd abcd;xAxisName=x axis;yAxisName=y's axis;bgColor=f2fec0;animation=1 ]
  221. # Defult Parameter Separator is ";"
  222. function setChartParams($strParam){
  223. $listArray=explode($this->del,$strParam);
  224. foreach ($listArray as $valueArray) {
  225. $paramValue=explode("=",$valueArray,2);
  226. if($this->validateParam($paramValue)==true){
  227. $this->chartParams[$paramValue[0]]=$this->encodeSpecialChars($paramValue[1]);
  228. }
  229. }
  230. }
  231. # Setting Categories Parameter into categoriesParam variables
  232. function setCategoriesParams($strParam){
  233. $this->categoriesParam .= $this->ConvertParamToXMLAttribute($strParam);
  234. }
  235. # Function addCategoryFromDatabase adding Category from dataset
  236. function addCategoryFromDatabase($query_result, $categoryColumn){
  237. if($this->DataBaseType=="mysql"){
  238. # fetching recordset till eof
  239. while($row = mysql_fetch_array($query_result)){
  240. # add category
  241. $this->addCategory($row[$categoryColumn],"","" );
  242. }
  243. }elseif($this->DataBaseType=="oracle"){
  244. # fetching recordset till eof
  245. while(OCIFetchInto($query_result, $row, OCI_ASSOC)){
  246. # add category
  247. $this->addCategory($row[$categoryColumn],"","" );
  248. }
  249. }
  250. }
  251. # Function addCategoryFromArray adding Category from Array
  252. function addCategoryFromArray($categoryArray){
  253. # convert array to category set
  254. foreach ($categoryArray as $value) {
  255. # adding category
  256. $this->addCategory($value);
  257. }
  258. }
  259. # Function for create set and catagory, dataset , set from array
  260. function addChartDataFromArray($dataArray, $dataCatArray=""){
  261. if(is_array($dataArray)){
  262. if ($this->seriesType==1){
  263. # Single series Array
  264. # aa[..][..]="name" aa[..][..]="value"
  265. foreach($dataArray as $arrayvalue){
  266. if(is_array($arrayvalue)){
  267. $this->addChartData($arrayvalue[1],"name=" . $arrayvalue[0] );
  268. }
  269. }
  270. }else{
  271. # Multi series Array
  272. if(is_array($dataCatArray)){
  273. foreach($dataCatArray as $value){
  274. $this->addCategory($value);
  275. }
  276. }
  277. foreach($dataArray as $arrayvalue){
  278. if(is_array($arrayvalue)){
  279. $i=0;
  280. $aaa[0]="";$aaa[1]="";
  281. foreach($arrayvalue as $value){
  282. if($i>=2){
  283. $this->addChartData($value);
  284. }else{
  285. $aaa[$i]=$value;
  286. }
  287. if($i==1){
  288. $this->addDataset($aaa[0],$aaa[1]);
  289. }
  290. $i++;
  291. }
  292. }
  293. }
  294. }
  295. }
  296. }
  297. # Function addCategory adding Category and vLine element
  298. function addCategory($label="",$catParam="",$vlineParam = "" ){
  299. $strCatXML="";
  300. $strParam="";
  301. $label=$this->encodeSpecialChars($label);
  302. # cheking vlineParam equal blank
  303. if($vlineParam==""){
  304. # cheking catParam not blank
  305. if($catParam!=""){
  306. $strParam = $this->ConvertParamToXMLAttribute($catParam);
  307. }
  308. # adding label and parameter set to category
  309. $strCatXML ="<category name='" . $label . "' " . $strParam . " />";
  310. }else{
  311. $strParam = $this->ConvertParamToXMLAttribute($vlineParam);
  312. # adding parameter set to vLine
  313. $strCatXML="<vLine " . $strParam . " />";
  314. }
  315. # storing into categoryNames array
  316. $this->categoryNames[$this->categoryNamesCounter]=$strCatXML;
  317. # Increase Counter
  318. $this->categoryNamesCounter++;
  319. }
  320. # adding dataset array element
  321. function addDataset($seriesName, $strParam=""){
  322. $this->datasetCounter++;
  323. $this->createDataset($this->datasetCounter);
  324. $this->setCounter++;
  325. $this->createDataValues($this->datasetCounter,"_" . $this->setCounter);
  326. $seriesName=$this->encodeSpecialChars($seriesName);
  327. # creating seriesName and dataset parameter set
  328. $tempParam="";
  329. $tempParam ="seriesName='" . $seriesName . "' ";
  330. $tempParam .= $this->ConvertParamToXMLAttribute($strParam);
  331. $colorParam="";
  332. $pos = strpos(strtolower($tempParam), " color");
  333. if ($pos === false) {
  334. $colorParam=" color='" . $this->getColor($this->datasetCounter-1) . "'";
  335. }
  336. # setting datasetParam array
  337. $this->datasetParam[$this->datasetCounter]=$tempParam . $colorParam;
  338. }
  339. # Function addChartData adding set data element
  340. function addChartData($value="",$setParam="",$vlineParam = "" ){
  341. $strSetXML="";
  342. # Choosing dataset depend on seriesType and getting XML set
  343. if($this->seriesType>=1 and $this->seriesType<=2){
  344. $strSetXML=$this->setSSMSDataArray($value,$setParam,$vlineParam);
  345. }elseif ($this->seriesType==3){
  346. $strSetXML=$this->setScatterBubbleDataArray($value,$setParam,$vlineParam);
  347. }elseif (($this->seriesType==4)){
  348. $strSetXML=$this->setSSMSDataArray($value,$setParam,$vlineParam);
  349. }
  350. # Adding xml set to dataset array and Increase set counter
  351. if ($this->seriesType==1){
  352. $this->dataset[$this->setCounter]=$strSetXML;
  353. $this->setCounter++;
  354. }elseif($this->seriesType>1 and $this->seriesType<4){
  355. $this->dataset[$this->datasetCounter]["_" . $this->setCounter]=$strSetXML;
  356. $this->setCounter++;
  357. }elseif($this->seriesType==4){
  358. $this->MSSDataset[$this->MSSDatasetCounter][$this->MSSSubDatasetCounter][$this->MSSSetCounter]=$strSetXML;
  359. $this->MSSSetCounter++;
  360. }
  361. }
  362. # The addDatasetsFromDatabase() function adds dataset and set elements from -
  363. # database, by Default, from MySql recordset. You can use setDatabaseType() function -
  364. # to set the type of database to work on.
  365. function addDatasetsFromDatabase($query_result, $ctrlField, $valueField,$datsetParamArray="",$link=""){
  366. # Initialize variables
  367. $paramset="";
  368. $tempContrl="";
  369. if(is_array($datsetParamArray)==false){
  370. $datsetParamArray=array();
  371. }
  372. # Calculate total no of array elements in datsetParamArray
  373. $arrLimit=count($datsetParamArray);
  374. $i=1;
  375. $tempParam="";
  376. if($this->DataBaseType=="mysql"){
  377. ##### For My SQL Connection
  378. $FieldArray=explode($this->del,$valueField);
  379. if(count($FieldArray)>1){
  380. ### Muli Series
  381. # fetching recordset
  382. while($row = mysql_fetch_array($query_result)){
  383. # Add Category
  384. $this->addCategory($row[$ctrlField]);
  385. }
  386. $k=0;
  387. # Add daatset for multiple fields
  388. foreach ($FieldArray as $FieldName) {
  389. if($k<$arrLimit){
  390. $tempParam = $datsetParamArray[$k];
  391. }else{
  392. $tempParam="";
  393. }
  394. # Add Dataset with adddataset() function
  395. $this->addDataset($FieldName,$tempParam);
  396. # rewind query result
  397. mysql_data_seek($query_result,0);
  398. while($row = mysql_fetch_array($query_result)){
  399. # Generating URL link
  400. if($link==""){
  401. $paramset="";
  402. }else{
  403. # Generating URL link from getLinkFromPattern
  404. $paramset="link=" . urlencode($this->getLinkFromPattern($row,$link));
  405. }
  406. # add value to dataset
  407. $this->addChartData($row[$FieldName], $paramset, "");
  408. }
  409. $k++;
  410. }
  411. }else{
  412. ### Single Series
  413. # fetching recordset
  414. while($row = mysql_fetch_array($query_result)){
  415. # Creating Control break depending on ctrlField
  416. # if ctrlField value changes then dataset will be Generated
  417. if ($tempContrl!=$row[$ctrlField]){
  418. if($i<=$arrLimit){
  419. $tempParam = $datsetParamArray[$i-1];
  420. }else{
  421. $tempParam="";
  422. }
  423. # Add Dataset with adddataset() function
  424. $this->addDataset($row[$ctrlField],$tempParam);
  425. $tempContrl=$row[$ctrlField];
  426. $i++;
  427. }
  428. # Generating URL link
  429. if($link==""){
  430. $paramset="";
  431. }else{
  432. # Generating URL link from getLinkFromPattern
  433. $paramset="link=" . urlencode($this->getLinkFromPattern($row,$link));
  434. }
  435. # add value to dataset
  436. $this->addChartData($row[$valueField], $paramset, "");
  437. }
  438. }
  439. }elseif($this->DataBaseType=="oracle"){
  440. # For Oracle Connection
  441. # fetching recordset
  442. while(OCIFetchInto($query_result, $row, OCI_ASSOC)){
  443. # Create Control break depending on ctrlField
  444. # if ctrlField value changes then dataset will be Generated
  445. if ($tempContrl!=$row[$ctrlField]){
  446. if($i<=$arrLimit){
  447. $tempParam = $datsetParamArray[$i-1];
  448. }else{
  449. $tempParam="";
  450. }
  451. # add Dataset
  452. $this->addDataset($row[$ctrlField],$tempParam);
  453. $tempContrl=$row[$ctrlField];
  454. $i++;
  455. }
  456. # Generating URL link
  457. if($link==""){
  458. $paramset="";
  459. }else{
  460. # Generating URL link from getLinkFromPattern
  461. $paramset="link=" . urlencode($this->getLinkFromPattern($row,$link));
  462. }
  463. # add value to dataset
  464. $this->addChartData($row[$valueField], $paramset, "");
  465. }
  466. }
  467. }
  468. # addDataFromDatabase funcion take 5 parameter like query_result, label field, value field
  469. # and initialize dataset variables and link
  470. function addDataFromDatabase($query_result, $db_field_ChartData,$db_field_CategoryNames="", $strParam="",$LinkPlaceHolder=""){
  471. $paramset="";
  472. if($this->DataBaseType=="mysql"){
  473. # fetching recordset till eof
  474. while($row = mysql_fetch_array($query_result)){
  475. if($LinkPlaceHolder==""){
  476. $paramset="";
  477. }else{
  478. # Getting link
  479. $paramset="link=" . urlencode($this->getLinkFromPattern($row,$LinkPlaceHolder));
  480. }
  481. if ($strParam=""){
  482. $strParam=$paramset;
  483. }else{
  484. $strParam .= ";" . $paramset;
  485. }
  486. # covert to set element and save to $partXML
  487. if($db_field_CategoryNames==""){
  488. $data=@$row[$db_field_ChartData];
  489. if($strParam!="")
  490. $this->addChartData($this->encodeSpecialChars($data),$strParam);
  491. else
  492. $this->addChartData($this->encodeSpecialChars($data));
  493. }
  494. else{
  495. $data=@$row[$db_field_ChartData];
  496. $label=@$row[$db_field_CategoryNames];
  497. $this->addChartData($this->encodeSpecialChars($data),"name=" . $this->encodeSpecialChars($label) . ";" .$strParam,"" );
  498. }
  499. }
  500. }elseif($this->DataBaseType=="oracle"){
  501. # fetching recordset till eof
  502. while(OCIFetchInto($query_result, $row, OCI_ASSOC)){
  503. if($LinkPlaceHolder==""){
  504. $paramset="";
  505. }else{
  506. # Getting link
  507. $paramset="link=" . urlencode($this->getLinkFromPattern($row,$LinkPlaceHolder));
  508. }
  509. if ($strParam=""){
  510. $strParam=$paramset;
  511. }else{
  512. $strParam .= ";" . $paramset;
  513. }
  514. # covert to set element and save to $partXML
  515. if($db_field_CategoryNames==""){
  516. $data=@$row[$db_field_ChartData];
  517. if($strParam!="")
  518. $this->addChartData($this->encodeSpecialChars($data),$strParam);
  519. else
  520. $this->addChartData($this->encodeSpecialChars($data));
  521. }
  522. else{
  523. $data=@$row[$db_field_ChartData];
  524. $label=@$row[$db_field_CategoryNames];
  525. $this->addChartData($this->encodeSpecialChars($data),"name=" . $this->encodeSpecialChars($label) . ";" .$strParam,"" );
  526. }
  527. }
  528. }
  529. }
  530. # setTLine create TrendLine parameter
  531. function addTrendLine($strParam){
  532. $listArray=explode($this->del,$strParam);
  533. foreach ($listArray as $valueArray) {
  534. $paramValue=explode("=",$valueArray,2);
  535. if($this->validateParam($paramValue)==true){
  536. $this->trendLines[$this->tLineCounter][$paramValue[0]]=$this->encodeSpecialChars($paramValue[1]);
  537. }
  538. }
  539. $this->tLineCounter++;
  540. }
  541. #this function sets chart messages
  542. function setChartMessage($strParam){
  543. $this->chartMSG="?";
  544. $listArray=explode($this->del,$strParam);
  545. foreach ($listArray as $valueArray) {
  546. $paramValue=explode("=",$valueArray,2);
  547. if($this->validateParam($paramValue)==true){
  548. $this->chartMSG.=$paramValue[0] . "=" . $this->encodeSpecialChars($paramValue[1]) . "&";
  549. }
  550. }
  551. $this->chartMSG=substr($this->chartMSG,0,strlen($this->chartMSG)-1);
  552. }
  553. #### - This function is mostly for Future USE -----------------------------
  554. # set JS constructor of FusionCharts.js
  555. function setAddChartParams($debugMode, $registerWithJS=0, $c="", $scaleMode="", $lang=""){
  556. $this->JSC["debugmode"]=$debugMode;
  557. $this->JSC["registerwithjs"]=$registerWithJS;
  558. $this->JSC["bgcolor"]=$c;
  559. $this->JSC["scalemode"]=$scaleMode;
  560. $this->JSC["lang"]=$lang;
  561. }
  562. # The function SetInitParam() adds extra chart settings
  563. function setInitParam($tname,$tvalue){
  564. $trimName= strtolower(str_replace(" ","",$tname));
  565. $this->JSC[$trimName]=$tvalue;
  566. }
  567. # getXML render all class arrays to XML output
  568. function getXML(){
  569. $this->strXML="";
  570. $strChartParam="";
  571. $strChartParam=$this->getChartParamsXML();
  572. if($this->seriesType==1){
  573. if(gettype(strpos($this->chartType,"line"))!="boolean"){
  574. if(strpos($strChartParam,"lineColor")===false){
  575. $colorSet=$this->getColor(0);
  576. $this->setChartParams("lineColor=" . $colorSet );
  577. }
  578. }
  579. if(gettype(strpos($this->chartType,"area"))!="boolean"){
  580. if(strpos($strChartParam,"areaBgColor")===false){
  581. $colorSet=$this->getColor(0);
  582. $this->setChartParams("areaBgColor=" . $colorSet );
  583. }
  584. }
  585. }
  586. # calling getChartParamsXML function for chart parameter
  587. $this->strXML = "<graph " . $this->getChartParamsXML() . " >";
  588. if ($this->seriesType >= 0 and $this->seriesType <= 4) {
  589. # calling getCategoriesXML function for Category element
  590. $this->strXML .= $this->getCategoriesXML();
  591. # calling getDatasetXML function for set element
  592. $this->strXML .= $this->getDatasetXML();
  593. # calling getvTrendLinesXML function for vTrendLines element
  594. if($this->seriesType==3){
  595. $this->strXML .= $this->getvTrendLinesXML();
  596. }
  597. # Calling getLinesetXML
  598. if($this->seriesType==4){
  599. $this->strXML .= $this->getLinesetXML();
  600. }
  601. # calling getTrendLinesXML function for TrendLines element
  602. $this->strXML .= $this->getTrendLinesXML();
  603. # calling getStylesXML function for Styles element
  604. $this->strXML .= $this->getStylesXML();
  605. }else if($this->seriesType == 5) {
  606. $this->strXML .= $this->getGanttCategoriesXML();
  607. $this->strXML .= $this->getProcessesXML();
  608. $this->strXML .= $this->getGanttDatatableXML();
  609. $this->strXML .= $this->getTasksXML();
  610. $this->strXML .= $this->getConnectorsXML();
  611. $this->strXML .= $this->getMilestonesXML();
  612. # calling getTrendLinesXML function for TrendLines element
  613. $this->strXML .= $this->getTrendLinesXML();
  614. # calling getStylesXML function for Styles element
  615. $this->strXML .= $this->getStylesXML();
  616. $this->strXML .= $this->getLegendXML();
  617. }
  618. # Closing Chart element
  619. $this->strXML .= "</graph>";
  620. $this->strXML = chr(239) . chr(187) . chr(191) . '<?xml version="1.0" encoding="UTF-8"?>' . $this->strXML;
  621. # Return XML output
  622. return $this->strXML;
  623. }
  624. # set wMode
  625. function setwMode($isTransparent=""){
  626. $this->wMode=$isTransparent;
  627. }
  628. # Function getXML render all class arrays to XML output
  629. function renderChart($isHTML=false, $display=true){
  630. $this->strXML=$this->getXML();
  631. $this->SWFFile=$this->SWFPath . "FCF_" . $this->chartSWF[$this->chartType][0] . ".swf";
  632. if($this->noCache==true){
  633. if($this->chartMSG==""){
  634. $this->chartMSG = "?nocache=" . microtime();
  635. }else{
  636. $this->chartMSG .= "&nocache=" . microtime();
  637. }
  638. }
  639. # print the charts
  640. if($isHTML==false){
  641. if($display){
  642. print $this->renderChartJS($this->SWFFile . $this->chartMSG,"",$this->strXML,$this->chartID, $this->width, $this->height,$this->JSC["debugmode"], $this->JSC["registerwithjs"],$this->wMode);
  643. }else{
  644. return $this->renderChartJS($this->SWFFile . $this->chartMSG,"",$this->strXML,$this->chartID, $this->width, $this->height,$this->JSC["debugmode"], $this->JSC["registerwithjs"],$this->wMode);
  645. }
  646. }else{
  647. if($display){
  648. print $this->renderChartHTML($this->SWFFile . $this->chartMSG,"",$this->strXML,$this->chartID, $this->width, $this->height,$this->JSC["debugmode"], $this->JSC["registerwithjs"],$this->wMode);
  649. }else{
  650. return $this->renderChartHTML($this->SWFFile . $this->chartMSG,"",$this->strXML,$this->chartID, $this->width, $this->height,$this->JSC["debugmode"], $this->JSC["registerwithjs"],$this->wMode);
  651. }
  652. }
  653. }
  654. # Sets whether chart SWF files are not to be cached
  655. function setOffChartCaching($swfNoCache=false){
  656. $this->noCache=$swfNoCache;
  657. }
  658. # Renders Chart form External XML data source
  659. function renderChartFromExtXML($dataXML){
  660. print $this->renderChartJS($this->SWFFile,"",$dataXML,$this->chartID, $this->width, $this->height, $this->JSC["debugmode"], $this->JSC["registerwithjs"], $this->wMode);
  661. }
  662. // RenderChartJS renders the JavaScript + HTML code required to embed a chart.
  663. // This function assumes that you've already included the FusionCharts JavaScript class
  664. // in your page.
  665. // $chartSWF - SWF File Name (and Path) of the chart which you intend to plot
  666. // $strURL - If you intend to use dataURL method for this chart, pass the URL as this parameter. Else, set it to "" (in case of dataXML method)
  667. // $strXML - If you intend to use dataXML method for this chart, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method)
  668. // $chartId - Id for the chart, using which it will be recognized in the HTML page. Each chart on the page needs to have a unique Id.
  669. // $chartWidth - Intended width for the chart (in pixels)
  670. // $chartHeight - Intended height for the chart (in pixels)
  671. // $debugMode - Whether to start the chart in debug mode
  672. // $registerWithJS - Whether to ask chart to register itself with JavaScript
  673. // $setTransparent - Transparent mode
  674. function renderChartJS($chartSWF, $strURL, $strXML, $chartId, $chartWidth, $chartHeight, $debugMode=false, $registerWithJS=false, $setTransparent="") {
  675. //First we create a new DIV for each chart. We specify the name of DIV as "chartId"Div.
  676. //DIV names are case-sensitive.
  677. // The Steps in the script block below are:
  678. //
  679. // 1)In the DIV the text "Chart" is shown to users before the chart has started loading
  680. // (if there is a lag in relaying SWF from server). This text is also shown to users
  681. // who do not have Flash Player installed. You can configure it as per your needs.
  682. //
  683. // 2) The chart is rendered using FusionCharts Class. Each chart's instance (JavaScript) Id
  684. // is named as chart_"chartId".
  685. //
  686. // 3) Check whether to provide data using dataXML method or dataURL method
  687. // save the data for usage below
  688. $strHTML="";
  689. if ($strXML=="")
  690. $tempData = "\t//Set the dataURL of the chart\n\tchart_$chartId.setDataURL(\"$strURL\");";
  691. else
  692. $tempData = "\t//Provide entire XML data using dataXML method\n\tchart_$chartId.setDataXML(\"$strXML\");";
  693. // Set up necessary variables for the RENDERCHART
  694. $chartIdDiv = $chartId . "Div";
  695. $ndebugMode = $this->boolToNum($debugMode);
  696. $nregisterWithJS = $this->boolToNum($registerWithJS);
  697. $nsetTransparent=($setTransparent?"true":"false");
  698. // Create a string for output by the caller
  699. $strHTML .= "\n<!-- START Script Block for Chart $chartId --> \n\n";
  700. $strHTML .= "<div id=\"$chartIdDiv\">\n";
  701. $strHTML .= "\tChart.\n";
  702. $strHTML .= "</div>\n";
  703. $strHTML .= "<script type=\"text/javascript\" >\n";
  704. //Instantiate the Chart
  705. $strHTML .= "\tvar chart_$chartId = new FusionChartMaker(\"$chartSWF\", \"$chartId\", \"$chartWidth\", \"$chartHeight\", \"$ndebugMode\", \"$nregisterWithJS\", \"" . $this->JSC["bgcolor"] . "\",\"" . $this->JSC["scalemode"] . "\",\"" . $this->JSC["lang"] . "\"); \n";
  706. if($nsetTransparent=="true"){
  707. $strHTML .= "\tchart_$chartId.setTransparent(\"$nsetTransparent\");\n";
  708. }
  709. $strHTML .= $tempData . "\n";
  710. //Finally, render the chart.
  711. $strHTML .= "\tchart_$chartId.render(\"$chartIdDiv\");\n";
  712. $strHTML .= "</script>\n\n";
  713. $strHTML .= "<!-- END Script Block for Chart $chartId -->\n";
  714. return $strHTML;
  715. }
  716. //RenderChartHTML function renders the HTML code for the JavaScript. This
  717. //method does NOT embed the chart using JavaScript class. Instead, it uses
  718. //direct HTML embedding. So, if you see the charts on IE 6 (or above), you'll
  719. //see the "Click to activate..." message on the chart.
  720. // $chartSWF - SWF File Name (and Path) of the chart which you intend to plot
  721. // $strURL - If you intend to use dataURL method for this chart, pass the URL as this parameter. Else, set it to "" (in case of dataXML method)
  722. // $strXML - If you intend to use dataXML method for this chart, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method)
  723. // $chartId - Id for the chart, using which it will be recognized in the HTML page. Each chart on the page needs to have a unique Id.
  724. // $chartWidth - Intended width for the chart (in pixels)
  725. // $chartHeight - Intended height for the chart (in pixels)
  726. // $debugMode - Whether to start the chart in debug mode
  727. // $registerWithJS - Whether to ask chart to register itself with JavaScript
  728. // $setTransparent - Transparent mode
  729. function renderChartHTML($chartSWF, $strURL, $strXML, $chartId, $chartWidth, $chartHeight, $debugMode=false,$registerWithJS=false, $setTransparent="") {
  730. // Generate the FlashVars string based on whether dataURL has been provided or dataXML.
  731. $strHTML="";
  732. $strFlashVars = "&chartWidth=" . $chartWidth . "&chartHeight=" . $chartHeight . "&debugMode=" . $this->boolToNum($debugMode);
  733. $strFlashVars .= "&scaleMode=" . $this->JSC["scalemode"] . "&lang=" . $this->JSC["lang"];
  734. if ($strXML=="")
  735. // DataURL Mode
  736. $strFlashVars .= "&dataURL=" . $strURL;
  737. else
  738. //DataXML Mode
  739. $strFlashVars .= "&dataXML=" . $strXML;
  740. $nregisterWithJS = $this->boolToNum($registerWithJS);
  741. if($setTransparent!=""){
  742. $nsetTransparent=($setTransparent==false?"opaque":"transparent");
  743. }else{
  744. $nsetTransparent="window";
  745. }
  746. $strHTML .= "\n<!-- START Code Block for Chart $chartId -->\n\n";
  747. $HTTP="http";
  748. if(strtolower($_SERVER['HTTPS'])=="on")
  749. {
  750. $HTTP="https";
  751. }
  752. $Strval = $_SERVER['HTTP_USER_AGENT'];
  753. $pos=strpos($Strval,"MSIE");
  754. if($pos===false){
  755. $strHTML .= "<embed src=\"$chartSWF\" FlashVars=\"$strFlashVars&registerWithJS=$nregisterWithJS\" quality=\"high\" width=\"$chartWidth\" height=\"$chartHeight\" name=\"$chartId\" " . ($this->JSC["bgcolor"]!="")? " bgcolor=\"" . $this->JSC["bgcolor"] . "\"":"" . " allowScriptAccess=\"always\" type=\"application/x-shockwave-flash\" pluginspage=\"$HTTP://www.macromedia.com/go/getflashplayer\" wmode=\"$nsetTransparent\" \n";
  756. }else{
  757. $strHTML .= "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"$HTTP://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"$chartWidth\" height=\"$chartHeight\" id=\"$chartId\"> \n";
  758. $strHTML .= "\t<param name=\"allowScriptAccess\" value=\"always\" /> \n";
  759. $strHTML .= "\t<param name=\"movie\" value=\"$chartSWF\" /> \n";
  760. $strHTML .= "\t<param name=\"FlashVars\" value=\"$strFlashVars&registerWithJS=$nregisterWithJS\" /> \n";
  761. $strHTML .= "\t<param name=\"quality\" value=\"high\" /> \n";
  762. $strHTML .= "\t<param name=\"wmode\" value=\"$nsetTransparent\" /> \n";
  763. //Set background color
  764. if($this->JSC["bgcolor"] !="") {
  765. $strHTML .= "\t<param name=\"bgcolor\" value=\"" . $this->JSC["bgcolor"] . "\" /> \n";
  766. }
  767. $strHTML .= "</object>\n";
  768. $strHTML .= "<!-- END Code Block for Chart $chartId -->\n";
  769. }
  770. return $strHTML;
  771. }
  772. // The function boolToNum() function converts boolean values to numeric (1/0)
  773. function boolToNum($bVal) {
  774. return (($bVal==true) ? 1 : 0);
  775. }
  776. ##------------ PRIVATE FUNCTIONS ----------------------------------------------------------------
  777. # getDatasetXML create set chart xml
  778. function getDatasetXML(){
  779. # Calling dataset function depending on seriesType
  780. switch ($this->seriesType){
  781. case 1 :
  782. return $this->getSSDatasetXML();
  783. break;
  784. case 2 :
  785. return $this->getMSDatasetXML();
  786. break;
  787. case 3 :
  788. return $this->getMSDatasetXML();
  789. break;
  790. case 4 :
  791. return $this->getMSStackedDatasetXML();
  792. break;
  793. }
  794. }
  795. # By getChartParamsXML, we can fetch charts array and convert into XML
  796. # and return like "caption='xyz' xAxisName='x side' ............
  797. function getChartParamsXML(){
  798. $partXML="";
  799. # feching charts each array and converting into chat parameter
  800. foreach($this->chartParams as $part_type => $part_name){
  801. $partXML .= $part_type . "='" . $this->encodeSpecialChars($part_name) . "' ";
  802. }
  803. # Return Chart Parameter
  804. return $partXML;
  805. }
  806. # Function getCategoriesXML for getting Category part XML
  807. function getCategoriesXML(){
  808. if($this->seriesType>1){
  809. $partXML="";
  810. # adding categories parameter
  811. $partXML="<categories " . $this->categoriesParam . " >";
  812. if($this->categoryNamesCounter>1){
  813. foreach($this->categoryNames as $part_type => $part_name){
  814. if($part_name!=""){
  815. # adding elements
  816. if($part_name!="Array"){
  817. $partXML .= $part_name;
  818. }
  819. }
  820. }
  821. }
  822. # Closing <categories>
  823. $partXML .="</categories>";
  824. return $partXML;
  825. }
  826. }
  827. # creating single set element
  828. # <set value='30' />
  829. # <set value='26' />
  830. function getSSDatasetXML(){
  831. if($this->seriesType==1){
  832. $partXML="";
  833. foreach($this->dataset as $part_type => $part_name){
  834. if($part_name!=""){
  835. # adding elements
  836. if($part_name!="Array"){
  837. $partXML .= $part_name;
  838. }
  839. }
  840. }
  841. return $partXML;
  842. }
  843. }
  844. # getMSDatasetXML for getting datset part XML
  845. # <dataset seriesName='Product A' color='AFD8F8' showValues='0'>
  846. # <set value='30' />
  847. # <set value='26' />
  848. # </dataset>
  849. function getMSDatasetXML(){
  850. if($this->seriesType>1){
  851. $partXML="";
  852. foreach($this->dataset as $part_type => $part_name){
  853. $partXML .="<dataset " . $this->datasetParam[$part_type] . " >";
  854. foreach($this->dataset[$part_type] as $part_type1 => $part_name1){
  855. if($part_name1!=""){
  856. # Adding elements
  857. if($part_name1!="Array"){
  858. $partXML .= $part_name1;
  859. }
  860. }
  861. }
  862. $partXML .="</dataset>";
  863. }
  864. return $partXML;
  865. }
  866. }
  867. # getTrendLinesXML create XML output depending on trendLines array
  868. # <trendLines>
  869. # <line startValue='700000' color='009933' displayvalue='Target' />
  870. # </trendLines>
  871. function getTrendLinesXML(){
  872. $partXML="";
  873. $lineXML="";
  874. # fetching trendLines array
  875. foreach($this->trendLines as $l_type => $l_name){
  876. # staring line element
  877. $lineXML .="<line ";
  878. # fetching trendLines array with in array element
  879. foreach($this->trendLines[$l_type] as $part_type => $part_name){
  880. $lineXML .= $part_type . "='" . $this->encodeSpecialChars($part_name) . "' ";
  881. }
  882. # close line element
  883. $lineXML .=" />";
  884. }
  885. # if line element present then adding $lineXML with in trendLines element
  886. $pos = strpos($lineXML, "=");
  887. if ($pos!==false){
  888. $partXML = "<trendLines>" . $lineXML . "</trendLines>";
  889. }else{
  890. # return nothing
  891. $partXML="";
  892. }
  893. # return trendLines xml
  894. return $partXML;
  895. }
  896. # adding set element to dataset element for seriesType 1 and 2
  897. function setSSMSDataArray($value="",$setParam="",$vlineParam = "" ){
  898. $strSetXML="";
  899. $strParam="";
  900. $color=0;
  901. if($vlineParam==""){
  902. if($setParam!=""){
  903. $strParam = $this->ConvertParamToXMLAttribute($setParam);
  904. }
  905. $colorSet="";
  906. if ($this->UserColorON == true){
  907. if($this->seriesType==1 && (gettype(strpos($this->chartType,"line"))=="boolean" && gettype(strpos($this->chartType,"area"))=="boolean")){
  908. if(strpos(strtolower($strParam)," color")===false){
  909. $colorSet=" color='" . $this->getColor($this->setCounter) . "' ";
  910. }
  911. }
  912. }else{
  913. if($this->seriesType==1 && (gettype(strpos($this->chartType,"pie"))=="boolean" && gettype(strpos($this->chartType,"line"))=="boolean" && gettype(strpos($this->chartType,"area"))=="boolean")){
  914. if(strpos(strtolower($strParam)," color")===false){
  915. $colorSet=" color='" . $this->getColor($this->setCounter) . "' ";
  916. }
  917. }
  918. }
  919. # setting set parameter
  920. $strSetXML ="<set value='" . $value . "' " . $strParam . $colorSet . " />";
  921. }else{
  922. $strParam = $this->ConvertParamToXMLAttribute($strParam);
  923. # setting vline parameter
  924. $strSetXML="<vLine " . $strParam . " />";
  925. }
  926. return $strSetXML;
  927. }
  928. ## - - - - - - Array Init Functions - - --- - -- - - - - - - -- - - - - -
  929. # Function createCategory create array element with in Categories
  930. function createCategory($catID){
  931. $this->categoryNames[$catID]= array();
  932. }
  933. # createDataset dataset array element
  934. function createDataset($dataID){
  935. $this->dataset[$dataID]= array();
  936. }
  937. # creating set dataset array element
  938. function createDataValues($datasetID, $dataID){
  939. $this->dataset[$datasetID][$dataID]= array();
  940. }
  941. # createTrendLines create TrendLines array
  942. function createTrendLines($lineID){
  943. $this->trendLines[$lineID] = array();
  944. }
  945. # setTLine create TrendLine parameter
  946. function setTLine($lineID,$paramName, $paramValue){
  947. $this->trendLines[$lineID][$paramName]=$paramValue;
  948. }
  949. # ----- ---------- ----- Misc utility functions ---- ------ -----------
  950. # converting ' and " to %26apos; and &quot;
  951. function encodeSpecialChars($strValue){
  952. $pattern="/%(?![\da-f]{2}|[\da-f]{4})/i";
  953. $strValue=preg_replace($pattern, "%25", $strValue);
  954. if ($this->encodeChars==true){
  955. $strValue=str_replace("&","%26",$strValue);
  956. $strValue=str_replace("'","%26apos;",$strValue);
  957. $strValue=str_replace("\"","%26quot;",$strValue);
  958. $strValue=preg_replace("/\<a/i", "%26lt;A", $strValue);
  959. $strValue=preg_replace("/\<\/a/i", "%26lt;/A", $strValue);
  960. $strValue=preg_replace("/\<i/i", "%26lt;I", $strValue);
  961. $strValue=preg_replace("/\<\/i/i", "%26lt;/I", $strValue);
  962. $strValue=preg_replace("/\<u/i", "%26lt;U", $strValue);
  963. $strValue=preg_replace("/\<\/u/i", "%26lt;/U", $strValue);
  964. $strValue=preg_replace("/\<li/i", "%26lt;LI", $strValue);
  965. $strValue=preg_replace("/\<\/li/i", "%26lt;/LI", $strValue);
  966. $strValue=preg_replace("/\<font/i", "%26lt;FONT", $strValue);
  967. $strValue=preg_replace("/\<\/font/i", "%26lt;/FONT", $strValue);
  968. $strValue=preg_replace("/\<p/i", "%26lt;P", $strValue);
  969. $strValue=preg_replace("/\<\/p/i", "%26lt;/P", $strValue);
  970. $strValue=preg_replace("/\<br/i", "%26lt;BR", $strValue);
  971. $strValue=preg_replace("/\<b/i", "%26lt;B", $strValue);
  972. $strValue=preg_replace("/\<\/b/i", "%26lt;/B", $strValue);
  973. $strValue=str_replace("<", "%ab",$strValue);
  974. $strValue=str_replace(">", "%26gt;",$strValue);
  975. }else{
  976. $strValue=str_replace("'","&apos;",$strValue);
  977. $strValue=str_replace("\"","&quot;",$strValue);
  978. $strValue=preg_replace("/\<a/i", "&lt;A", $strValue);
  979. $strValue=preg_replace("/\<\/a/i", "&lt;/A", $strValue);
  980. $strValue=preg_replace("/\<i/i", "&lt;I", $strValue);
  981. $strValue=preg_replace("/\<\/i/i", "&lt;/I", $strValue);
  982. $strValue=preg_replace("/\<u/i", "&lt;U", $strValue);
  983. $strValue=preg_replace("/\<\/u/i", "&lt;/U", $strValue);
  984. $strValue=preg_replace("/\<li/i", "&lt;LI", $strValue);
  985. $strValue=preg_replace("/\<\/li/i", "&lt;/LI", $strValue);
  986. $strValue=preg_replace("/\<font/i", "&lt;FONT", $strValue);
  987. $strValue=preg_replace("/\<\/font/i", "&lt;/FONT", $strValue);
  988. $strValue=preg_replace("/\<p/i", "&lt;P", $strValue);
  989. $strValue=preg_replace("/\<\/p/i", "&lt;/P", $strValue);
  990. $strValue=preg_replace("/\<br/i", "&lt;BR", $strValue);
  991. $strValue=preg_replace("/\<b/i", "&lt;B", $strValue);
  992. $strValue=preg_replace("/\<\/b/i", "&lt;/B", $strValue);
  993. $strValue=str_replace("<","%ab",$strValue);
  994. $strValue=str_replace(">", "&gt;",$strValue);
  995. }
  996. $strValue=str_replace("=","%3d",$strValue);
  997. $strValue=str_replace("+","%2b",$strValue);
  998. $strValue=str_replace("�","%a2",$strValue);
  999. $strValue=str_replace("�","%a3",$strValue);
  1000. $strValue=str_replace("�","%E2%82%AC",$strValue);
  1001. $strValue=str_replace("�","%a5",$strValue);
  1002. $strValue=str_replace("?","%e2%82%a3",$strValue);
  1003. return $strValue;
  1004. }
  1005. # Its convert pattern link to original link
  1006. # abcd.php?cid=##Field_name_1##&pname=##Field_name_2##
  1007. function getLinkFromPattern($row,$tempLink){
  1008. # convert link into array break on '##'
  1009. $aa=explode("##",$tempLink);
  1010. # Reading array
  1011. foreach($aa as $v){
  1012. # Finding '=' into array
  1013. $pos = strpos($v, "=");
  1014. # not found '='
  1015. if($pos === false){
  1016. if($v!=""){
  1017. $pet="##" . $v . "##";
  1018. $tempLink=str_replace($pet,$row[$v],$tempLink);
  1019. }
  1020. }
  1021. }
  1022. return $tempLink;
  1023. }
  1024. # convertion of semi colon(;) separeted paramater to XML attribute
  1025. function ConvertParamToXMLAttribute($strParam){
  1026. $xmlParam="";
  1027. $listArray=explode($this->del,$strParam);
  1028. foreach ($listArray as $valueArray) {
  1029. $paramValue=explode("=",$valueArray,2);
  1030. if($this->validateParam($paramValue)==true){
  1031. # creating parameter set
  1032. $xmlParam .= $paramValue[0] . "='" . $this->encodeSpecialChars($paramValue[1]) . "' ";
  1033. }
  1034. }
  1035. # Return
  1036. return $xmlParam;
  1037. }
  1038. function validateParam($paramValue){
  1039. if(count($paramValue)>=2){
  1040. if(trim($paramValue[0])==""){
  1041. return false;
  1042. }
  1043. return true;
  1044. }else{
  1045. return false;
  1046. }
  1047. }
  1048. # Getting Charts series type from charts array. 1 => single series, 2=> multi-series, 3=> scatter and bubble, 4=> MSStacked. defult 1 => single series
  1049. function getSeriesType(){
  1050. $sValue=1;
  1051. if(is_array($this->chartSWF[$this->chartType])){
  1052. $sValue=$this->chartSWF[$this->chartType][1];
  1053. }else{
  1054. $sValue=1;
  1055. }

Large files files are truncated, but you can click here to view the full file