• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Install FusionChart on CI as plugin Plugin

#4
[eluser]Iverson[/eluser]
[quote author="Amjith or Cool Coder" date="1226664378"]
Code:
<?php
function encodeDataURL($strDataURL, $addNoCacheStr=false) {
    if ($addNoCacheStr==true) {
                                if (strpos(strDataURL,"?")<>0)
                                            $strDataURL .= "&FCCurrTime;=" . Date("H_i_s");
                                else
                                            $strDataURL .= "?FCCurrTime=" . Date("H_i_s");
                 }
                return urlencode($strDataURL);
}
function datePart($mask, $dateTimeStr) {
    @list($datePt, $timePt) = explode(" ", $dateTimeStr);
    $arDatePt = explode("-", $datePt);
    $dataStr = "";
    if (count($arDatePt) == 3) {
        list($year, $month, $day) = $arDatePt;
        switch ($mask) {
        case "m": return (int)$month;
        case "d": return (int)$day;
        case "y": return (int)$year;
        }
           return (trim($month . "/" . $day . "/" . $year));
    }
    return $dataStr;
}
function renderChart($chartSWF, $strURL, $strXML, $chartId, $chartWidth, $chartHeight) {
    if ($strXML=="")
        $tempData = "//Set the dataURL of the chart\n\t\tchart_$chartId.setDataURL(\"$strURL\")";
    else
        $tempData = "//Provide entire XML data using dataXML method\n\t\tchart_$chartId.setDataXML(\"$strXML\")";
                    $chartIdDiv = $chartId . "Div";
                                $render_chart = <<<RENDERCHART
                                                                                        &lt;!-- START Script Block for Chart $chartId --&gt;
                                                                                        <div id="$chartIdDiv" align="center">
                                                                                            Chart.
                                                                                        </div>
                                                                                        [removed]    
                                                                                            //Instantiate the Chart    
                                                                                            var chart_$chartId = new FusionCharts("$chartSWF", "$chartId", "$chartWidth", "$chartHeight");
                                                                                           $tempData
                                                                                            //Finally, render the chart.
                                                                                            chart_$chartId.render("$chartIdDiv");
                                                                                        [removed]    
                                                                                        &lt;!-- END Script Block for Chart $chartId --&gt;
RENDERCHART;
  return $render_chart;
}
function renderChartHTML($chartSWF, $strURL, $strXML, $chartId, $chartWidth, $chartHeight) {
    $strFlashVars = "&chartWidth;=" . $chartWidth . "&chartHeight;=" . $chartHeight ;
    if ($strXML=="")
        $strFlashVars .= "&dataURL;=" . $strURL;
    else
        $strFlashVars .= "&dataXML;=" . $strXML;
$HTML_chart = <<&lt;HTMLCHART
    &lt;!-- START Code Block for Chart $chartId --&gt;
    &lt;OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"  width="$chartWidth" height="$chartHeight" id="$chartId">
        <param name="allowScriptAccess" value="always" />
        <param name="movie" value="$chartSWF"/>        
        <param name="FlashVars" value="$strFlashVars" />
        <param name="quality" value="high" />
        &lt;embed src="$chartSWF" FlashVars="$strFlashVars" quality="high" width="$chartWidth" height="$chartHeight" name="$chartId" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /&gt;
    &lt;/object&gt;
    &lt;!-- END Code Block for Chart $chartId --&gt;
HTMLCHART;
  return $HTML_chart;
}
function boolToNum($bVal) {
    return (($bVal==true) ? 1 : 0);
}
?&gt;


My next post will be of creating Fusionchart library on CI.[/quote]

This code is REALLY not CI-ish. Nor is it copy and "pastable". I will try to rewrite it and post this later.


Messages In This Thread
Install FusionChart on CI as plugin Plugin - by El Forum - 11-14-2008, 12:06 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 11-14-2008, 08:11 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 11-14-2008, 10:16 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 03-17-2009, 11:00 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 03-17-2009, 11:05 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 11-25-2009, 03:44 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 01-28-2010, 07:46 AM
Install FusionChart on CI as plugin Plugin - by El Forum - 01-28-2010, 08:31 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.