]> git.andy128k.dev Git - ipf.git/commitdiff
Fusion Chart
authoravl <alex.litovchenko@gmail.com>
Thu, 16 Oct 2008 22:03:20 +0000 (01:03 +0300)
committeravl <alex.litovchenko@gmail.com>
Thu, 16 Oct 2008 22:03:20 +0000 (01:03 +0300)
24 files changed:
ipf.php
ipf/admin/media/chart/Area2D.swf [new file with mode: 0644]
ipf/admin/media/chart/Bar2D.swf [new file with mode: 0644]
ipf/admin/media/chart/Column2D.swf [new file with mode: 0644]
ipf/admin/media/chart/Column3D.swf [new file with mode: 0644]
ipf/admin/media/chart/Doughnut2D.swf [new file with mode: 0644]
ipf/admin/media/chart/Doughnut3D.swf [new file with mode: 0644]
ipf/admin/media/chart/FusionCharts.js [new file with mode: 0644]
ipf/admin/media/chart/Line.swf [new file with mode: 0644]
ipf/admin/media/chart/MSArea.swf [new file with mode: 0644]
ipf/admin/media/chart/MSBar2D.swf [new file with mode: 0644]
ipf/admin/media/chart/MSBar3D.swf [new file with mode: 0644]
ipf/admin/media/chart/MSColumn2D.swf [new file with mode: 0644]
ipf/admin/media/chart/MSColumn3D.swf [new file with mode: 0644]
ipf/admin/media/chart/MSLine.swf [new file with mode: 0644]
ipf/admin/media/chart/Pie2D.swf [new file with mode: 0644]
ipf/admin/media/chart/Pie3D.swf [new file with mode: 0644]
ipf/admin/media/chart/SSGrid.swf [new file with mode: 0644]
ipf/admin/media/chart/StackedArea2D.swf [new file with mode: 0644]
ipf/admin/media/chart/StackedBar2D.swf [new file with mode: 0644]
ipf/admin/media/chart/StackedBar3D.swf [new file with mode: 0644]
ipf/admin/media/chart/StackedColumn2D.swf [new file with mode: 0644]
ipf/admin/media/chart/StackedColumn3D.swf [new file with mode: 0644]
ipf/chart.php [new file with mode: 0644]

diff --git a/ipf.php b/ipf.php
index 15a1692ab1b8856095d2d13b7368813a59a7a7fd..eb627562f52afe3e8ef1cbd9a546f433ee2001a4 100644 (file)
--- a/ipf.php
+++ b/ipf.php
@@ -2,20 +2,20 @@
 
 // Lazy ClassLoader
 function __autoload( $class_name ){
-    $s = '';                                                                    
+    $s = '';
     $a =  explode( '_', $class_name );
-    foreach( $a as &$folder ){                                                  
-        if ( $s!='' )                                                           
-            $s .= '/';                                                  
-        $s .= strtolower( $folder );                                            
+    foreach( $a as &$folder ){
+        if ( $s!='' )
+            $s .= '/';
+        $s .= strtolower( $folder );
     }
     require_once($s.'.php');
 }
 
 final class IPF{
-    
+
     private static $settings = array();
-    
+
     private static function applySettings($settings){
         foreach($settings as $key=>$val){
             IPF::$settings[strtolower($key)] = $val;
@@ -25,7 +25,7 @@ final class IPF{
     private static function loadSettings(){
         $settings_file = IPF::$settings['project_path'].DIRECTORY_SEPARATOR.'settings.php';
         IPF::$settings['settings_file'] = $settings_file;
-        
+
         if (file_exists($settings_file))
             IPF::applySettings(require $settings_file);
         else
@@ -34,7 +34,7 @@ final class IPF{
         $settings_local_file = IPF::$settings['project_path'].DIRECTORY_SEPARATOR.'settings_local.php';
         if (file_exists($settings_local_file))
             IPF::applySettings(require $settings_local_file);
-        
+
         if (!isset(IPF::$settings['dsn']))
             throw new IPF_Exception_Settings('Please specify DSN in settings file');
         else
@@ -58,7 +58,7 @@ final class IPF{
             if (array_search('IPF_Admin',IPF::$settings['applications']))
                 IPF::$settings['template_dirs'][] = IPF::$settings['ipf_path'].DIRECTORY_SEPARATOR.'ipf'.DIRECTORY_SEPARATOR.'admin'.DIRECTORY_SEPARATOR.'templates';
         }
-        
+
         if (!isset(IPF::$settings['debug'])){
             IPF::$settings['debug'] = false;
         }
@@ -113,13 +113,13 @@ final class IPF{
 
        private function __construct(){}
        private function __clone(){}
-       
+
        public static function get($name,$default=null){
            if (isset(IPF::$settings[$name]))
                return IPF::$settings[$name];
            return $default;
        }
-       
+
     public static function loadFunction($function)
     {
         if (function_exists($function)) {
@@ -154,3 +154,5 @@ function __($str)
     $t = trim($str);
     return $t;
 }
+
+
diff --git a/ipf/admin/media/chart/Area2D.swf b/ipf/admin/media/chart/Area2D.swf
new file mode 100644 (file)
index 0000000..7d43169
Binary files /dev/null and b/ipf/admin/media/chart/Area2D.swf differ
diff --git a/ipf/admin/media/chart/Bar2D.swf b/ipf/admin/media/chart/Bar2D.swf
new file mode 100644 (file)
index 0000000..682320a
Binary files /dev/null and b/ipf/admin/media/chart/Bar2D.swf differ
diff --git a/ipf/admin/media/chart/Column2D.swf b/ipf/admin/media/chart/Column2D.swf
new file mode 100644 (file)
index 0000000..f62480e
Binary files /dev/null and b/ipf/admin/media/chart/Column2D.swf differ
diff --git a/ipf/admin/media/chart/Column3D.swf b/ipf/admin/media/chart/Column3D.swf
new file mode 100644 (file)
index 0000000..a8ee25c
Binary files /dev/null and b/ipf/admin/media/chart/Column3D.swf differ
diff --git a/ipf/admin/media/chart/Doughnut2D.swf b/ipf/admin/media/chart/Doughnut2D.swf
new file mode 100644 (file)
index 0000000..6d86241
Binary files /dev/null and b/ipf/admin/media/chart/Doughnut2D.swf differ
diff --git a/ipf/admin/media/chart/Doughnut3D.swf b/ipf/admin/media/chart/Doughnut3D.swf
new file mode 100644 (file)
index 0000000..22ec4ef
Binary files /dev/null and b/ipf/admin/media/chart/Doughnut3D.swf differ
diff --git a/ipf/admin/media/chart/FusionCharts.js b/ipf/admin/media/chart/FusionCharts.js
new file mode 100644 (file)
index 0000000..d6d9562
--- /dev/null
@@ -0,0 +1,342 @@
+/**\r
+ * FusionCharts: Flash Player detection and Chart embedding.\r
+ * Version: 1.2.3 (15th September, 2008) - Added fix for % and & characters. Additional fixes to properly handle double quotes and single quotes in setDataXML() function.\r
+ * Version: 1.2.2 (10th July, 2008) - Added fix for % scaled dimensions, fixes in setDataXML() and setDataURL() functions\r
+ * Version: 1.2.1 (21st December, 2007) - Added setting up transparent/opaque mode: setTransparent() function \r
+ * Version: 1.2 (1st November, 2007) - Added FORM fixes for IE \r
+ * Version: 1.1 (29th June, 2007) - Added Player detection, New conditional fixes for IE\r
+ *\r
+ * Morphed from SWFObject (http://blog.deconcept.com/swfobject/) under MIT License:\r
+ * http://www.opensource.org/licenses/mit-license.php\r
+ *\r
+ */\r
+if(typeof infosoftglobal == "undefined") var infosoftglobal = new Object();\r
+if(typeof infosoftglobal.FusionChartsUtil == "undefined") infosoftglobal.FusionChartsUtil = new Object();\r
+infosoftglobal.FusionCharts = function(swf, id, w, h, debugMode, registerWithJS, c, scaleMode, lang, detectFlashVersion, autoInstallRedirect){\r
+       if (!document.getElementById) { return; }\r
+       \r
+       //Flag to see whether data has been set initially\r
+       this.initialDataSet = false;\r
+       \r
+       //Create container objects\r
+       this.params = new Object();\r
+       this.variables = new Object();\r
+       this.attributes = new Array();\r
+       \r
+       //Set attributes for the SWF\r
+       if(swf) { this.setAttribute('swf', swf); }\r
+       if(id) { this.setAttribute('id', id); }\r
+\r
+       debugMode = debugMode ? debugMode : 0;\r
+       this.addVariable('debugMode', debugMode);\r
+\r
+       w=w.toString().replace(/\%$/,"%25");\r
+       if(w) { this.setAttribute('width', w); }\r
+       h=h.toString().replace(/\%$/,"%25");\r
+       if(h) { this.setAttribute('height', h); }\r
+\r
+       \r
+       //Set background color\r
+       if(c) { this.addParam('bgcolor', c); }\r
+       \r
+       //Set Quality   \r
+       this.addParam('quality', 'high');\r
+       \r
+       //Add scripting access parameter\r
+       this.addParam('allowScriptAccess', 'always');\r
+       \r
+       //Pass width and height to be appended as chartWidth and chartHeight\r
+       this.addVariable('chartWidth', w);\r
+       this.addVariable('chartHeight', h);\r
+\r
+       //Whether in debug mode\r
+       //Pass DOM ID to Chart\r
+       this.addVariable('DOMId', id);\r
+       //Whether to registed with JavaScript\r
+       registerWithJS = registerWithJS ? registerWithJS : 0;\r
+       this.addVariable('registerWithJS', registerWithJS);\r
+       \r
+       //Scale Mode of chart\r
+       scaleMode = scaleMode ? scaleMode : 'noScale';\r
+       this.addVariable('scaleMode', scaleMode);\r
+       \r
+       //Application Message Language\r
+       lang = lang ? lang : 'EN';\r
+       this.addVariable('lang', lang);\r
+       \r
+       //Whether to auto detect and re-direct to Flash Player installation\r
+       this.detectFlashVersion = detectFlashVersion?detectFlashVersion:1;\r
+       this.autoInstallRedirect = autoInstallRedirect?autoInstallRedirect:1;\r
+       \r
+       //Ger Flash Player version \r
+       this.installedVer = infosoftglobal.FusionChartsUtil.getPlayerVersion();\r
+       \r
+       if (!window.opera && document.all && this.installedVer.major > 7) {\r
+               // Only add the onunload cleanup if the Flash Player version supports External Interface and we are in IE\r
+               infosoftglobal.FusionCharts.doPrepUnload = true;\r
+       }\r
+}\r
+\r
+infosoftglobal.FusionCharts.prototype = {\r
+       setAttribute: function(name, value){\r
+               this.attributes[name] = value;\r
+       },\r
+       getAttribute: function(name){\r
+               return this.attributes[name];\r
+       },\r
+       addParam: function(name, value){\r
+               this.params[name] = value;\r
+       },\r
+       getParams: function(){\r
+               return this.params;\r
+       },\r
+       addVariable: function(name, value){\r
+               this.variables[name] = value;\r
+       },\r
+       getVariable: function(name){\r
+               return this.variables[name];\r
+       },\r
+       getVariables: function(){\r
+               return this.variables;\r
+       },\r
+       getVariablePairs: function(){\r
+               var variablePairs = new Array();\r
+               var key;\r
+               var variables = this.getVariables();\r
+               for(key in variables){\r
+                       variablePairs.push(key +"="+ variables[key]);\r
+               }\r
+               return variablePairs;\r
+       },\r
+       getSWFHTML: function() {\r
+               var swfNode = "";\r
+               if (navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length) { \r
+                       // netscape plugin architecture                 \r
+                       swfNode = '<embed type="application/x-shockwave-flash" src="'+ this.getAttribute('swf') +'" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'"  ';\r
+                       swfNode += ' id="'+ this.getAttribute('id') +'" name="'+ this.getAttribute('id') +'" ';\r
+                       var params = this.getParams();\r
+                        for(var key in params){ swfNode += [key] +'="'+ params[key] +'" '; }\r
+                       var pairs = this.getVariablePairs().join("&");\r
+                        if (pairs.length > 0){ swfNode += 'flashvars="'+ pairs +'"'; }\r
+                       swfNode += '/>';\r
+               } else { // PC IE                       \r
+                       swfNode = '<object id="'+ this.getAttribute('id') +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+ this.getAttribute('width') +'" height="'+ this.getAttribute('height') +'">';\r
+                       swfNode += '<param name="movie" value="'+ this.getAttribute('swf') +'" />';\r
+                       var params = this.getParams();\r
+                       for(var key in params) {\r
+                        swfNode += '<param name="'+ key +'" value="'+ params[key] +'" />';\r
+                       }\r
+                       var pairs = this.getVariablePairs().join("&");                  \r
+                       if(pairs.length > 0) {swfNode += '<param name="flashvars" value="'+ pairs +'" />';}\r
+                       swfNode += "</object>";\r
+               }\r
+               return swfNode;\r
+       },\r
+       setDataURL: function(strDataURL){\r
+               //This method sets the data URL for the chart.\r
+               //If being set initially\r
+               if (this.initialDataSet==false){\r
+                       this.addVariable('dataURL',strDataURL);\r
+                       //Update flag\r
+                       this.initialDataSet = true;\r
+               }else{\r
+                       //Else, we update the chart data using External Interface\r
+                       //Get reference to chart object\r
+                       var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute('id'));\r
+                       \r
+                       if (!chartObj.setDataURL)\r
+                       {\r
+                               __flash__addCallback(chartObj, "setDataURL");\r
+                       }\r
+                       \r
+                       chartObj.setDataURL(strDataURL);\r
+               }\r
+       },\r
+       //This function :\r
+       //fixes the double quoted attributes to single quotes\r
+       //Encodes all quotes inside attribute values\r
+       //Encodes % to %25 and & to %26;\r
+       encodeDataXML: function(strDataXML){\r
+               \r
+                       var regExpReservedCharacters=["\\$","\\+"];\r
+                       var arrDQAtt=strDataXML.match(/=\s*\".*?\"/g);\r
+                       if (arrDQAtt){\r
+                               for(var i=0;i<arrDQAtt.length;i++){\r
+                                       var repStr=arrDQAtt[i].replace(/^=\s*\"|\"$/g,"");\r
+                                       repStr=repStr.replace(/\'/g,"%26apos;");\r
+                                       var strTo=strDataXML.indexOf(arrDQAtt[i]);\r
+                                       var repStrr="='"+repStr+"'";\r
+                                       var strStart=strDataXML.substring(0,strTo);\r
+                                       var strEnd=strDataXML.substring(strTo+arrDQAtt[i].length);\r
+                                       var strDataXML=strStart+repStrr+strEnd;\r
+                               }\r
+                       }\r
+                       \r
+                       strDataXML=strDataXML.replace(/\"/g,"%26quot;");\r
+                       strDataXML=strDataXML.replace(/%(?![\da-f]{2}|[\da-f]{4})/ig,"%25");\r
+                       strDataXML=strDataXML.replace(/\&/g,"%26");\r
+\r
+                       return strDataXML;\r
+\r
+       },\r
+       setDataXML: function(strDataXML){\r
+               //If being set initially\r
+               if (this.initialDataSet==false){\r
+                       //This method sets the data XML for the chart INITIALLY.\r
+                       this.addVariable('dataXML',this.encodeDataXML(strDataXML));\r
+                       //Update flag\r
+                       this.initialDataSet = true;\r
+               }else{\r
+                       //Else, we update the chart data using External Interface\r
+                       //Get reference to chart object\r
+                       var chartObj = infosoftglobal.FusionChartsUtil.getChartObject(this.getAttribute('id'));\r
+                       chartObj.setDataXML(strDataXML);\r
+               }\r
+       },\r
+       setTransparent: function(isTransparent){\r
+               //Sets chart to transparent mode when isTransparent is true (default)\r
+               //When no parameter is passed, we assume transparent to be true.\r
+               if(typeof isTransparent=="undefined") {\r
+                       isTransparent=true;\r
+               }                       \r
+               //Set the property\r
+               if(isTransparent)\r
+                       this.addParam('WMode', 'transparent');\r
+               else\r
+                       this.addParam('WMode', 'Opaque');\r
+       },\r
+       \r
+       render: function(elementId){\r
+               //First check for installed version of Flash Player - we need a minimum of 8\r
+               if((this.detectFlashVersion==1) && (this.installedVer.major < 8)){\r
+                       if (this.autoInstallRedirect==1){\r
+                               //If we can auto redirect to install the player?\r
+                               var installationConfirm = window.confirm("You need Adobe Flash Player 8 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. Please click on Ok to install the same.");\r
+                               if (installationConfirm){\r
+                                       window.location = "http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";\r
+                               }else{\r
+                                       return false;\r
+                               }\r
+                       }else{\r
+                               //Else, do not take an action. It means the developer has specified a message in the DIV (and probably a link).\r
+                               //So, expect the developers to provide a course of way to their end users.\r
+                               //window.alert("You need Adobe Flash Player 8 (or above) to view the charts. It is a free and lightweight installation from Adobe.com. ");\r
+                               return false;\r
+                       }                       \r
+               }else{\r
+                       //Render the chart\r
+                       var n = (typeof elementId == 'string') ? document.getElementById(elementId) : elementId;\r
+                       n.innerHTML = this.getSWFHTML();\r
+                       \r
+                       //Added <FORM> compatibility\r
+                       //Check if it's added in Mozilla embed array or if already exits \r
+                       if(!document.embeds[this.getAttribute('id')] && !window[this.getAttribute('id')])\r
+                       window[this.getAttribute('id')]=document.getElementById(this.getAttribute('id')); \r
+                               //or else document.forms[formName/formIndex][chartId]                   \r
+                       return true;            \r
+               }\r
+       }\r
+}\r
+\r
+/* ---- detection functions ---- */\r
+infosoftglobal.FusionChartsUtil.getPlayerVersion = function(){\r
+       var PlayerVersion = new infosoftglobal.PlayerVersion([0,0,0]);\r
+       if(navigator.plugins && navigator.mimeTypes.length){\r
+               var x = navigator.plugins["Shockwave Flash"];\r
+               if(x && x.description) {\r
+                       PlayerVersion = new infosoftglobal.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/, "").replace(/(\s+r|\s+b[0-9]+)/, ".").split("."));\r
+               }\r
+       }else if (navigator.userAgent && navigator.userAgent.indexOf("Windows CE") >= 0){ \r
+               //If Windows CE\r
+               var axo = 1;\r
+               var counter = 3;\r
+               while(axo) {\r
+                       try {\r
+                               counter++;\r
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+ counter);\r
+                               PlayerVersion = new infosoftglobal.PlayerVersion([counter,0,0]);\r
+                       } catch (e) {\r
+                               axo = null;\r
+                       }\r
+               }\r
+       } else { \r
+               // Win IE (non mobile)\r
+               // Do minor version lookup in IE, but avoid Flash Player 6 crashing issues\r
+               try{\r
+                       var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");\r
+               }catch(e){\r
+                       try {\r
+                               var axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");\r
+                               PlayerVersion = new infosoftglobal.PlayerVersion([6,0,21]);\r
+                               axo.AllowScriptAccess = "always"; // error if player version < 6.0.47 (thanks to Michael Williams @ Adobe for this code)\r
+                       } catch(e) {\r
+                               if (PlayerVersion.major == 6) {\r
+                                       return PlayerVersion;\r
+                               }\r
+                       }\r
+                       try {\r
+                               axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");\r
+                       } catch(e) {}\r
+               }\r
+               if (axo != null) {\r
+                       PlayerVersion = new infosoftglobal.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));\r
+               }\r
+       }\r
+       return PlayerVersion;\r
+}\r
+infosoftglobal.PlayerVersion = function(arrVersion){\r
+       this.major = arrVersion[0] != null ? parseInt(arrVersion[0]) : 0;\r
+       this.minor = arrVersion[1] != null ? parseInt(arrVersion[1]) : 0;\r
+       this.rev = arrVersion[2] != null ? parseInt(arrVersion[2]) : 0;\r
+}\r
+// ------------ Fix for Out of Memory Bug in IE in FP9 ---------------//\r
+/* Fix for video streaming bug */\r
+infosoftglobal.FusionChartsUtil.cleanupSWFs = function() {\r
+       var objects = document.getElementsByTagName("OBJECT");\r
+       for (var i = objects.length - 1; i >= 0; i--) {\r
+               objects[i].style.display = 'none';\r
+               for (var x in objects[i]) {\r
+                       if (typeof objects[i][x] == 'function') {\r
+                               objects[i][x] = function(){};\r
+                       }\r
+               }\r
+       }\r
+}\r
+// Fixes bug in fp9\r
+if (infosoftglobal.FusionCharts.doPrepUnload) {\r
+       if (!infosoftglobal.unloadSet) {\r
+               infosoftglobal.FusionChartsUtil.prepUnload = function() {\r
+                       __flash_unloadHandler = function(){};\r
+                       __flash_savedUnloadHandler = function(){};\r
+                       window.attachEvent("onunload", infosoftglobal.FusionChartsUtil.cleanupSWFs);\r
+               }\r
+               window.attachEvent("onbeforeunload", infosoftglobal.FusionChartsUtil.prepUnload);\r
+               infosoftglobal.unloadSet = true;\r
+       }\r
+}\r
+/* Add document.getElementById if needed (mobile IE < 5) */\r
+if (!document.getElementById && document.all) { document.getElementById = function(id) { return document.all[id]; }}\r
+/* Add Array.push if needed (ie5) */\r
+if (Array.prototype.push == null) { Array.prototype.push = function(item) { this[this.length] = item; return this.length; }}\r
+\r
+/* Function to return Flash Object from ID */\r
+infosoftglobal.FusionChartsUtil.getChartObject = function(id)\r
+{\r
+  var chartRef=null;\r
+  if (navigator.appName.indexOf("Microsoft Internet")==-1) {\r
+    if (document.embeds && document.embeds[id])\r
+      chartRef = document.embeds[id]; \r
+       else\r
+       chartRef  = window.document[id];\r
+  }\r
+  else {\r
+    chartRef = window[id];\r
+  }\r
+  if (!chartRef)\r
+       chartRef  = document.getElementById(id);\r
+  \r
+  return chartRef;\r
+}\r
+/* Aliases for easy usage */\r
+var getChartFromId = infosoftglobal.FusionChartsUtil.getChartObject;\r
+var FusionCharts = infosoftglobal.FusionCharts;
\ No newline at end of file
diff --git a/ipf/admin/media/chart/Line.swf b/ipf/admin/media/chart/Line.swf
new file mode 100644 (file)
index 0000000..f6abe73
Binary files /dev/null and b/ipf/admin/media/chart/Line.swf differ
diff --git a/ipf/admin/media/chart/MSArea.swf b/ipf/admin/media/chart/MSArea.swf
new file mode 100644 (file)
index 0000000..2f9a52f
Binary files /dev/null and b/ipf/admin/media/chart/MSArea.swf differ
diff --git a/ipf/admin/media/chart/MSBar2D.swf b/ipf/admin/media/chart/MSBar2D.swf
new file mode 100644 (file)
index 0000000..801ac0c
Binary files /dev/null and b/ipf/admin/media/chart/MSBar2D.swf differ
diff --git a/ipf/admin/media/chart/MSBar3D.swf b/ipf/admin/media/chart/MSBar3D.swf
new file mode 100644 (file)
index 0000000..fc2b7e3
Binary files /dev/null and b/ipf/admin/media/chart/MSBar3D.swf differ
diff --git a/ipf/admin/media/chart/MSColumn2D.swf b/ipf/admin/media/chart/MSColumn2D.swf
new file mode 100644 (file)
index 0000000..501e081
Binary files /dev/null and b/ipf/admin/media/chart/MSColumn2D.swf differ
diff --git a/ipf/admin/media/chart/MSColumn3D.swf b/ipf/admin/media/chart/MSColumn3D.swf
new file mode 100644 (file)
index 0000000..f90d765
Binary files /dev/null and b/ipf/admin/media/chart/MSColumn3D.swf differ
diff --git a/ipf/admin/media/chart/MSLine.swf b/ipf/admin/media/chart/MSLine.swf
new file mode 100644 (file)
index 0000000..3551024
Binary files /dev/null and b/ipf/admin/media/chart/MSLine.swf differ
diff --git a/ipf/admin/media/chart/Pie2D.swf b/ipf/admin/media/chart/Pie2D.swf
new file mode 100644 (file)
index 0000000..e538a02
Binary files /dev/null and b/ipf/admin/media/chart/Pie2D.swf differ
diff --git a/ipf/admin/media/chart/Pie3D.swf b/ipf/admin/media/chart/Pie3D.swf
new file mode 100644 (file)
index 0000000..2667d6d
Binary files /dev/null and b/ipf/admin/media/chart/Pie3D.swf differ
diff --git a/ipf/admin/media/chart/SSGrid.swf b/ipf/admin/media/chart/SSGrid.swf
new file mode 100644 (file)
index 0000000..8925679
Binary files /dev/null and b/ipf/admin/media/chart/SSGrid.swf differ
diff --git a/ipf/admin/media/chart/StackedArea2D.swf b/ipf/admin/media/chart/StackedArea2D.swf
new file mode 100644 (file)
index 0000000..e698780
Binary files /dev/null and b/ipf/admin/media/chart/StackedArea2D.swf differ
diff --git a/ipf/admin/media/chart/StackedBar2D.swf b/ipf/admin/media/chart/StackedBar2D.swf
new file mode 100644 (file)
index 0000000..59554d5
Binary files /dev/null and b/ipf/admin/media/chart/StackedBar2D.swf differ
diff --git a/ipf/admin/media/chart/StackedBar3D.swf b/ipf/admin/media/chart/StackedBar3D.swf
new file mode 100644 (file)
index 0000000..d456bf9
Binary files /dev/null and b/ipf/admin/media/chart/StackedBar3D.swf differ
diff --git a/ipf/admin/media/chart/StackedColumn2D.swf b/ipf/admin/media/chart/StackedColumn2D.swf
new file mode 100644 (file)
index 0000000..ce9efda
Binary files /dev/null and b/ipf/admin/media/chart/StackedColumn2D.swf differ
diff --git a/ipf/admin/media/chart/StackedColumn3D.swf b/ipf/admin/media/chart/StackedColumn3D.swf
new file mode 100644 (file)
index 0000000..d818f7a
Binary files /dev/null and b/ipf/admin/media/chart/StackedColumn3D.swf differ
diff --git a/ipf/chart.php b/ipf/chart.php
new file mode 100644 (file)
index 0000000..20304d0
--- /dev/null
@@ -0,0 +1,32 @@
+<?php
+
+class IPF_Chart{
+
+    // $chartSWF - SWF File Name (and Path) of the chart which you intend to plot
+       // $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)
+       // $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)
+       // $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.
+       // $chartWidth - Intended width for the chart (in pixels)
+       // $chartHeight - Intended height for the chart (in pixels)
+       // $debugMode - Whether to start the chart in debug mode
+       // $registerWithJS - Whether to ask chart to register itself with JavaScript
+       static function RenderChart($chartSWF, $strURL, $strXML, $chartId, $chartWidth, $chartHeight, $debugMode=false, $registerWithJS=false, $setTransparent="") {
+               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";
+           $ndebugMode = IPF_Chart::BoolToNum($debugMode);
+           $nregisterWithJS = IPF_Chart::BoolToNum($registerWithJS);
+               $nsetTransparent=($setTransparent?"true":"false");
+               $render_chart =
+               "<div id=\"$chartIdDiv\">Chart</div>\n".
+               "<script type=\"text/javascript\">var chart_$chartId = new FusionCharts('$chartSWF', '$chartId', '$chartWidth', '$chartHeight', '$ndebugMode', '$nregisterWithJS'); chart_$chartId.setTransparent('$nsetTransparent');  $tempData;      chart_$chartId.render('$chartIdDiv');</script>";
+               return $render_chart;
+       }
+
+       static function BoolToNum($bVal) {
+       return (($bVal==true) ? 1 : 0);
+       }
+}