ࡱ> Root Entryp|YrRASH{%͘Contents.Page 1 Page 2Root Entryp|YrRASH 0ИContents.Page 18Page 2   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Page 3[Page 4  !"#$%&'()*+,-./012345679:;<=>?CPicPage CPicLayer CPicFrame?&F?JavaScriptHandler//This frame responds to JavaScript data. //First, we check if new data has been actually supplied if (isNewData == "1" && (newData != undefined && newData != null)) { //Means new data has been supplied //Get the new data TxmlDataDoc = new XML(); TxmlDataDoc.parseXML(newData); //Clear the real time interval clearInterval(realTimeInterval); //Now, clear the chart objects already rendered (with depth starting from this.Params.bgDepth to _lastLevel) for (tObj in this) { //Get a reference to all objects present in the current timeline var obj = this[tObj]; //If the object is a movieClip and it's depth is between our required depths if ((obj.getDepth()<=_lastLevel) && (obj.getDepth()>=FIChart.Params.bgDepth)) { obj.removeMovieClip(); deleteText(obj.getDepth()); } delete obj; } //Re-set the global counter _lastLevel = FIChart.Params.bgDepth; //Delete FIChart delete FIChart; //If the data is not valid - show error msg and stop if (TxmlDataDoc.status != 0) { //However if the XML Data is not well-formed, Show an error createText(1, "Invalid XML Data", _chartHorCenter, _chartVerCenter, "Verdana", "10", LPBarTextColor, false, "center", "center", null, false); //Stop the control of the movie gotoAndStop("ErrorStop"); } else { //Else, goto and play the first frame - i.e., re-render the chart gotoAndPlay(1); } } else { //Else- just stay normal stop(); }? ErrorStop'//Just stop stop(); JavaScript HandlerO?6V/* This frame is invoked, when the chart .swf file has been downloaded onto the end user's machine and the XML file has also been downloaded. In this frame, we'll: - Load the Chart Class - Instantiate an object representing the Chart Class */ //Next, we instantiate an object representing the chart class FIChart = new Chart(); //Acquire the data from the global XML document FIChart.acquireData(); //Parse the data into the Chart arrays and variables. FIChart.parseData(); //Calculate the co-ordinates of various elements on the chart FIChart.calculatePoints(); //Move to the next frame. play(); ?cI/* This frame is a part of the chart rendering process. It is invoked when the chart class has been loaded, an object representing it initialized and XML data has been parsed. Here, we do the following: 1. Hide the rendering chart textbox. 2. Render the various Chart elements */ //First, we hide the "Rendering Chart" textbox deleteText(1); //Also, delete the size calculate movie clip deleteText(25001); //Allot chart depths FIChart.allotDepths(); //Render background FIChart.drawBackground(); //Load Bacgkround swf FIChart.loadBgSWF(); //Create the chart FIChart.renderChart(); //Render the custom objects FIChart.drawCustomObjects(); //Render the *raw* hover caption FIChart.renderHoverCap(); stop();  Actions3?vm//** Chart Class **// //Chart is the base object on which the whole charting model will be based Chart = function () { // ** Initialize the objects within this class **// // Chart.xmlData represents the complete XML data supplied to FusionCharts this.xmlData = new XML(); // Chart.data is an array which would be used to store data this.data = new Array(); // Chart.Params would be used to store the graph properties this.Params = new Object(); // Chart.Constants would be used to store the graph constants this.Constants = new Object(); // Chart.Objects would be used to store the co-ordinates of a number of objects this.Objects = new Array(); // Chart.customObjects is an array which would be used to store custom objects this.customObjects = new Array(); // ** Set the data/properties of a few objects **/ // Params.num indicates the number of data sets passed to the graph this.Params.num = 0; // Params.numNonZero indicates the nu Page 3Page 4CPicPage CPicLayer CPicFrame? ? Layer 1OCPicPage CPicLayer CPicFrame? Layer 1OCPicPage CPicLayer CPicFrame?T Layer 1OCPicPage CPicLayer CPicFrame?F Layer 1O) CDocumentPagePage 1 PreloaderB=BPage 2 ChartLoadB>BPage 3DataLoadB?BPage 4ChartB@BpXhhhhhx CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3ff`zf*]hmber of data sets with value as zero this.Params.numNonZero = 0; // Params.funnelBaseHeight indicates the height of the base of the funnel this.Params.funnelBaseHeight = 0; // Params.funnelBaseHeight indicates the width of the base of the funnel this.Params.funnelBaseWidth = 0; // Params.numDataBelowFunnel indicates the number of data lie in the base of the funnel this.Params.numDataBelowFunnel = 0; // Sum of values this.Params.sumOfValues = 0; // Params.numCustomObjects indicates the number of custom objects groups passed to the graph this.Params.numCustomObjects = 0; // Params.numCustomObjectsUC indicates the number of custom objects that we've to show below the chart this.Params.numCustomObjectsUC = 0; // Some constants to be used throughout the movie this.Constants.funnelYScale = 10; this.Constants.calcTextXPos = Number(getFirstValue(calcTextXPos, -200)); this.Constants.calcTextYPos = Number(getFirstValue(calcTextYPos, -200)); }; //** Nested Objects **// /* Nested objects are sub-objects whose instance we'll later create and store in the instance of Chart Object. Basically, we are trying to group the data under various heads. */ Chart.dataItem = function(dataName, dataValue, dataColor, dataLink, dataAlpha, hoverText, borderColor, borderThickness, borderAlpha) { //Chart.dataItem indicates an object which is going to contain the data //and other related details for a particular element this.name = dataName; this.value = dataValue; this.color = dataColor; this.link = dataLink; this.alpha = dataAlpha; this.hoverText = hoverText; this.borderColor = borderColor; this.borderThickness = borderThickness; this.borderAlpha = borderAlpha; //xPos are dynamically calculated values //which will help us draw the on the stage. this.xPos = 0; this.yPos = 0; //Value tb position this.valueTbXPos = 0; this.valueTbYPos = 0; }; Chart.cObject = function(xPos, yPos, objHeight, objWidth) { //Chart.cObject represents an individual element on the chart this.xPos = xPos; this.yPos = yPos; this.height = objHeight; this.width = objWidth; }; Chart.customObjectParams = function() { // An invisible object used to store the custom object attributes }; Chart.customObjectItem = function(itemType, url, itemXPos, itemYPos, itemToXPos, itemToYPos, numSides, startAngle, endAngle, itemAlpha, itemColor, itemXScale, itemYScale, itemRadius, itemInnerRadius, align, vAlign, label, font, fontSize, fontColor, isBold, fillAsGradient, fillColor, fillRatio, fillDegree, fillAlpha, fillPattern, showBorder, borderColor, borderThickness, borderAlpha, thickness) { this.type = itemType; this.url = url; this.xPos = itemXPos; this.yPos = itemYPos; this.toXPos = itemToXPos; this.toYPos = itemToYPos; this.numSides = numSides; this.startAngle = startAngle; this.endAngle = endAngle; this.alpha = itemAlpha; this.color = itemColor; this.xScale = itemXScale; this.yScale = itemYScale; this.radius = itemRadius; this.innerRadius = itemInnerRadius; this.align = align; this.vAlign = vAlign; this.label = label; this.font = font; this.fontSize = fontSize; this.fontColor = fontColor; this.isBold = isBold; this.fillAsGradient = fillAsGradient; this.fillColor = fillColor; this.fillRatio = fillRatio; this.fillDegree = fillDegree; this.fillAlpha = fillAlpha; this.fillPattern = fillPattern; this.showBorder = showBorder; this.borderColor = borderColor; this.borderThickness = borderThickness; this.borderAlpha = borderAlpha; this.thickness = thickness; }; //** Methods **// Chart.prototype.acquireData = function() { //This function acquires the data from the global XML object //into the Chart class this.xmlData = TxmlDataDoc; //Delete the global object to free up memory resources delete TxmlDataDoc; }; Chart.prototype.parseData = function() { //This function parses the XML data document, retrieves the //data and stores it into various arrays and objects of the Chart class //levelOneNodes gets reference to the first level nodes - i.e, and associates (if any) var levelOneNodes = this.xmlData.childNodes; //Iterate through each level one node to search for the graph node for (i=0; i<=levelOneNodes.length; i++) { //Check if the node name is Graph/CHART if (levelOneNodes[i].nodeName.toUpperCase() == "CHART" || levelOneNodes[i].nodeName.toUpperCase() == "GRAPH") { //The current node is GRAPH node //So, extract the properties of the graph (which have been provided as attributes of the GRAPH node) //For each property, we also have a pre-set default value which would //be allotted only if the XML doesn't specify a value for the parameter //Background color of the chart this.Params.bgColor = formatHexColor(getFirstValue(levelOneNodes[i].attributes.bgColor, "FFFFFF")); this.Params.bgAlpha = Number(getFirstValue(levelOneNodes[i].attributes.bgAlpha, 100)); //Background swf this.Params.bgSWF = levelOneNodes[i].attributes.bgSWF; //Configuration to set whether to show the names or not this.Params.showNames = Number(getFirstValue(levelOneNodes[i].attributes.showNames, 1)); this.Params.showValues = Number(getFirstValue(levelOneNodes[i].attributes.showValues, 1)); //Animation this.Params.animation = Number(getFirstValue(levelOneNodes[i].attributes.animation, 1)); //Hover Caption - Show/Hide, Background Color, Border Color, Separator Character this.Params.showHoverCap = Number(getFirstValue(levelOneNodes[i].attributes.showHoverCap, 1)); this.Params.hoverCapBgColor = formatHexColor(getFirstValue(levelOneNodes[i].attributes.hoverCapBgColor, levelOneNodes[i].attributes.hoverCapBg, "F1F1F1")); this.Params.hoverCapBorderColor = formatHexColor(getFirstValue(levelOneNodes[i].attributes.hoverCapBorderColor, levelOneNodes[i].attributes.hoverCapBorder, "666666")); this.Params.hoverCapSepChar = getFirstValue(levelOneNodes[i].attributes.hoverCapSepChar, ", "); //Font Properties this.Params.baseFont = getFirstValue(levelOneNodes[i].attributes.baseFont, "Verdana"); this.Params.baseFontSize = Number(getFirstValue(levelOneNodes[i].attributes.baseFontSize, 9)); this.Params.baseFontColor = formatHexColor(getFirstValue(levelOneNodes[i].attributes.baseFontColor, "000000")); //Configuration to set the uppermost funnel radius this.Params.funnelRadius = levelOneNodes[i].attributes.funnelRadius; //Configuration to set border properties this.Params.showBorder = Number(getFirstValue(levelOneNodes[i].attributes.showBorder, 0)); this.Params.borderThickness = Number(getFirstValue(levelOneNodes[i].attributes.borderThickness, 1)); this.Params.borderColor = levelOneNodes[i].attributes.borderColor; this.Params.borderAlpha = Number(getFirstValue(levelOneNodes[i].attributes.borderAlpha, 100)); this.Params.fillAlpha = Number(getFirstValue(levelOneNodes[i].attributes.fillAlpha, 100)); //Configuration to set whether to show the data in sliced format this.Params.isSliced = Number(getFirstValue(levelOneNodes[i].attributes.isSliced, 0)); //Configuration to set the slicing distance between the funnels this.Params.slicingDistance = Number(getFirstValue(levelOneNodes[i].attributes.slicingDistance, 10)); //Option to format the base of the funnel this.Params.funnelBaseHeight = levelOneNodes[i].attributes.funnelBaseHeight; this.Params.funnelBaseWidth = levelOneNodes[i].attributes.funnelBaseWidth; //Option whether the format the number (using Commas) this.Params.formatNumber = Number(getFirstValue(levelOneNodes[i].attributes.formatNumber, 1)); //Option to format number scale this.Params.formatNumberScale = Number(getFirstValue(levelOneNodes[i].attributes.formatNumberScale, 1)); //Number prefix and suffix this.Params.numberPrefix = getFirstValue(this.unescapeStr(levelOneNodes[i].attributes.numberPrefix), ""); this.Params.numberSuffix = getFirstValue(this.unescapeStr(levelOneNodes[i].attributes.numberSuffix), ""); //Number scale properties this.Params.defaultNumberScale = getFirstValue(levelOneNodes[i].attributes.defaultNumberScale, ""); this.Params.numberScaleValue = getFirstValue(levelOneNodes[i].attributes.numberScaleValue, ""); this.Params.numberScaleUnit = getFirstValue(levelOneNodes[i].attributes.numberScaleUnit, ""); //Decimal Separator Character this.Params.decimalSeparator = getFirstValue(levelOneNodes[i].attributes.decimalSeparator, "."); //Thousand Separator Character this.Params.thousandSeparator = getFirstValue(levelOneNodes[i].attributes.thousandSeparator, ","); //Decimal Precision (number of decimal places to be rounded to) this.Params.decimalPrecision = Number(getFirstValue(levelOneNodes[i].attributes.decimalPrecision, 2)); //Decimal Precision cannot be less than 0 - so adjust it if (this.Params.decimalPrecision<0) { this.Params.decimalPrecision = 0; } //Chart Margins this.Params.chartLeftMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartLeftMargin, 15)); this.Params.chartRightMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartRightMargin, 15)); this.Params.chartTopMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartTopMargin, 10)); this.Params.chartBottomMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartBottomMargin, 10)); //All the properties have been extracted levelTwoNodes = levelOneNodes[i].childNodes; for (j=0; j<=levelTwoNodes.length; j++) { if (levelTwoNodes[j].nodeName.toUpperCase() == "SET") { this.Params.num++; //Extract the attributes var setValue = Number(getFirstValue(levelTwoNodes[j].attributes.value, 0)); //Get the sum this.Params.sumOfValues = this.Params.sumOfValues+Math.abs(setValue); var setLink = unescape(levelTwoNodes[j].attributes.link); var setName = getFirstValue(levelTwoNodes[j].attributes.name, ""); var setAlpha = Number(getFirstValue(levelTwoNodes[j].attributes.alpha, this.Params.fillAlpha)); var setHoverText = getFirstValue(levelTwoNodes[j].attributes.hoverText, setName); var setColor = formatHexColor(getFirstValue(levelTwoNodes[j].attributes.color, defaultColors[this.Params.num%defaultColors.length])); var borderColor = formatHexColor(getFirstValue(levelTwoNodes[j].attributes.borderColor, this.Params.borderColor, setColor)); var borderThickness = Number(getFirstValue(levelTwoNodes[j].attributes.borderThickness, this.Params.borderThickness)); var borderAlpha = Number(getFirstValue(levelTwoNodes[j].attributes.borderAlpha, this.Params.borderAlpha)); //Create the object to represent it this.data[this.Params.num] = new Chart.dataItem(setName, setValue, setColor, setLink, setAlpha, setHoverText, borderColor, borderThickness, borderAlpha); } else if (levelTwoNodes[j].nodeName.toUpperCase() == "CUSTOMOBJECTS") { //Check for the custom object node //So, extract the data levelThreeNodes = levelTwoNodes[j].childNodes; for (k=0; k<=levelThreeNodes.length; k++) { if (levelThreeNodes[k].nodeName.toUpperCase() == "OBJECTGROUP") { // Extract the attributes this.customObjects[this.Params.numCustomObjects] = new Chart.customObjectParams(); this.customObjects[this.Params.numCustomObjects].xPos = Number(getFirstValue(levelThreeNodes[k].attributes.xpos, 0)); this.customObjects[this.Params.numCustomObjects].yPos = Number(getFirstValue(levelThreeNodes[k].attributes.ypos, 0)); this.customObjects[this.Params.numCustomObjects].xScale = Number(getFirstValue(levelThreeNodes[k].attributes.xScale, 100)); this.customObjects[this.Params.numCustomObjects].yScale = Number(getFirstValue(levelThreeNodes[k].attributes.yScale, 100)); this.customObjects[this.Params.numCustomObjects].alpha = Number(getFirstValue(levelThreeNodes[k].attributes.alpha, 100)); this.customObjects[this.Params.numCustomObjects].showBelowChart = Number(getFirstValue(levelThreeNodes[k].attributes.showBelowChart, 1)); //If we've to show below chart, update the count if (this.customObjects[this.Params.numCustomObjects].showBelowChart == 1) { this.Params.numCustomObjectsUC++; } //Extract the custom objects items now //Create the array for it this.customObjects[this.Params.numCustomObjects].items = new Array(); this.customObjects[this.Params.numCustomObjects].numItems = 0; levelFourNodes = levelThreeNodes[k].childNodes; for (l=0; l<=levelFourNodes.length; l++) { //If it's an OBJECT node if (levelFourNodes[l].nodeName.toUpperCase() == "OBJECT") { //Extract the attributes var itemType = levelFourNodes[l].attributes.type; var url = levelFourNodes[l].attributes.url; var itemXPos = Number(getFirstValue(levelFourNodes[l].attributes.xPos, 0)); var itemYPos = Number(getFirstValue(levelFourNodes[l].attributes.yPos, 0)); var itemToXPos = Number(getFirstValue(levelFourNodes[l].attributes.toXPos, itemXPos)); var itemToYPos = Number(getFirstValue(levelFourNodes[l].attributes.toYPos, itemYPos)); var numSides = Number(getFirstValue(levelFourNodes[l].attributes.numSides, 5)); var startAngle = Number(getFirstValue(levelFourNodes[l].attributes.startAngle, 0)); var endAngle = Number(getFirstValue(levelFourNodes[l].attributes.endAngle, 360)); var thickness = Number(getFirstValue(levelFourNodes[l].attributes.thickness, 1)); var itemXScale = Number(getFirstValue(levelFourNodes[l].attributes.xScale, 100)); var itemYScale = Number(getFirstValue(levelFourNodes[l].attributes.yScale, 100)); var itemRadius = Number(getFirstValue(levelFourNodes[l].attributes.radius, ((itemType.toUpperCase() == "RECTANGLE") ? 0 : 0.3*_chartHeight))); var itemInnerRadius = Number(getFirstValue(levelFourNodes[l].attributes.innerRadius, 0.8*itemRadius, 0.2*_chartHeight)); var itemAlpha = Number(getFirstValue(levelFourNodes[l].attributes.alpha, 100)); var itemColor = formatHexColor(getFirstValue(levelFourNodes[l].attributes.color, "ff5904")); var align = getFirstValue(levelFourNodes[l].attributes.align, "center"); var vAlign = getFirstValue(levelFourNodes[l].attributes.vAlign, "center"); var label = getFirstValue(levelFourNodes[l].attributes.label, ""); var font = getFirstValue(levelFourNodes[l].attributes.font, "Verdana"); var fontSize = Number(getFirstValue(levelFourNodes[l].attributes.fontSize, 10)); var fontColor = formatHexColor(getFirstValue(levelFourNodes[l].attributes.fontColor, itemColor)); var isBold = Number(getFirstValue(levelFourNodes[l].attributes.isBold, 0)); var fillColor = getFirstValue(levelFourNodes[l].attributes.fillColor, itemColor, "FF5904"); var fillAsGradient = Number(getFirstValue(levelFourNodes[l].attributes.fillAsGradient, (fillColor.indexOf(",") == -1) ? (0) : (1))); var fillRatio = getFirstValue(levelFourNodes[l].attributes.fillRatio, ""); var fillDegree = getFirstValue(levelFourNodes[l].attributes.fillDegree, 0); var fillAlpha = getFirstValue(levelFourNodes[l].attributes.fillAlpha, String(itemAlpha), "100"); var fillPattern = getFirstValue(levelFourNodes[l].attributes.fillPattern, (itemType.toUpperCase() == "CIRCLE") ? ("radial") : ("linear")); var showBorder = Number(getFirstValue(levelFourNodes[l].attributes.showBorder, 0)); var borderColor = formatHexColor(getFirstValue(levelFourNodes[l].attributes.borderColor, "000000")); var borderThickness = Number(getFirstValue(levelFourNodes[l].attributes.borderThickness, 0)); var borderAlpha = Number(getFirstValue(levelFourNodes[l].attributes.borderAlpha, 100)); var thickness = Number(getFirstValue(levelFourNodes[l].attributes.thickness, 2)); //Only if type is defined and valid if (this.isValidCustomObjectType(itemType) == true) { //Update the counter & Create container this.customObjects[this.Params.numCustomObjects].items[this.customObjects[this.Params.numCustomObjects].numItems] = new Chart.customObjectItem(itemType, url, itemXPos, itemYPos, itemToXPos, itemToYPos, numSides, startAngle, endAngle, itemAlpha, itemColor, itemXScale, itemYScale, itemRadius, itemInnerRadius, align, vAlign, label, font, fontSize, fontColor, isBold, fillAsGradient, fillColor, fillRatio, fillDegree, fillAlpha, fillPattern, showBorder, borderColor, borderThickness, borderAlpha, thickness); this.customObjects[this.Params.numCustomObjects].numItems++; } } } //Increment the counter this.Params.numCustomObjects++; } } } } //Free memory resource delete setNodes; } } //Now, remove the unwanted data/objects from memory delete levelTwoNodes; delete levelOneNodes; }; Chart.prototype.calculatePoints = function() { //Firstly, swap the data values as first data appears on the bottom of the funnel. //This function calculates the pixel co-ordinates of all the elements on the chart. //Parse the number scale value & units //Number scale - break data into arrays if (this.Params.numberScaleValue.length == 0 || this.Params.numberScaleUnit.length == 0) { //Set global flag to false this.Params.bScalePresent = false; } else { //Set global flag this.Params.bScalePresent = true; //Split the data into arrays this.Params.nsv = new Array(); this.Params.nsu = new Array(); this.Params.nsv = this.Params.numberScaleValue.split(","); //Convert all number scale values to numbers for (i=0; ithis.Params.numDataBelowFunnel) { this.data[i].valueTbYPos += this.Constants.funnelYScale/2; } } }; Chart.prototype.formatNumber = function(number) { //This function formats a number in FusionCharts format var precision; precision = this.Params.decimalPrecision; var intNum = number; var strScale = ""; var loopVar = 0; //If number is to be scaled if (this.Params.formatNumberScale == 1) { var strScale = this.Params.defaultNumberScale; if (this.Params.bScalePresent == true) { for (loopVar=0; loopVar=this.Params.nsv[loopVar]) { strScale = this.Params.nsu[loopVar]; intNum = Number(intNum)/this.Params.nsv[loopVar]; } else { break; } } } } //Convert it into string var strNum = String(intNum); //We format the number if required if (this.Params.formatNumber == 1) { //Format the decimal precision strNum = Math.formatDecimals(intNum, precision); //Format the commas in the number strNum = formatCommas(String(strNum), this.Params.thousandSeparator, this.Params.decimalSeparator); } //Now, we append the prefix and the suffix if required strNum = this.Params.numberPrefix+strNum+strScale+this.Params.numberSuffix; return strNum; }; Chart.prototype.getLevel = function() { //This function returns the highest current level in the movie which does not contain an object. //Increase the last depth _lastLevel++; //Return it return _lastLevel; }; Chart.prototype.allotDepths = function() { //Background depth this.Params.bgDepth = this.getLevel(); this.Params.bgSWFDepth = this.getLevel(); //Under chart custom object depth this.Params.CustomObjectsUCDepth = this.getLevel(); //Update global counter _lastLevel += this.Params.numCustomObjectsUC; }; Chart.prototype.isValidCustomObjectType = function(itemType) { //This function checks whether the custom object type is valid //Assume valid first var bIsValid = true; //Invalid if null or undefined or empty if (itemType == "" || itemType == null || itemType == undefined) { bIsValid = false; } //Define a list of custom object types that FusionCharts currently allows var allowedTypes = new Array(); allowedTypes[0] = "LINE"; allowedTypes[1] = "TEXT"; allowedTypes[2] = "CIRCLE"; allowedTypes[3] = "POLYGON"; allowedTypes[4] = "RECTANGLE"; allowedTypes[5] = "IMAGE"; allowedTypes[6] = "ARC"; //By default assume that it's not valid. var bIsSpecifiedType = false; //Search if it's valid for (i=0; ithis.Params.numDataBelowFunnel && this.data[i].value != 0) { //Create the actual funnel if (i == this.Params.numDataBelowFunnel+1) { height = this.data[i].yPos-Math.round(funnelHeight)+1; xPos1 = this.data[i].xPos+this.Params.funnelBaseWidth; } else { height = this.data[i].yPos+this.Constants.funnelYScale/2; xPos1 = this.data[i].xPos+this.data[i-1].radius; } //Draw the cone for each data value mcLCFunnelHolder.beginGradientFill("linear", [parseInt(this.data[i].color, 16), getDarkColor(this.data[i].color, 0.8)], [100, 75], [40, 255], {matrixType:"box", x:this.data[i].xPos-this.data[i].radius, y:this.data[i].yPos-this.Constants.funnelYScale, w:this.data[i].radius*2, h:this.Constants.funnelYScale*2, r:(270/180)*Math.PI}); mcLCFunnelHolder.moveTo(this.data[i].xPos+this.data[i].radius, this.data[i].yPos-this.data[i].height+this.Constants.funnelYScale/2); //upper base of the cone mcLCFunnelHolder.drawFunnelWedge(this.data[i].xPos, this.data[i].yPos-this.data[i].height+this.Constants.funnelYScale/2, 0, 360, this.data[i].radius, this.Constants.funnelYScale); //End fill mcLCFunnelHolder.endFill(); //Begin the fill mcLCFunnelHolder.beginGradientFill("linear", [parseInt(this.data[i].color, 16), parseInt("ffffff", 16), parseInt(this.data[i].color, 16)], [this.data[i].alpha, this.data[i].alpha, this.data[i].alpha], [40, 127, 255], {matrixType:"box", x:this.data[i].xPos-this.data[i].radius, y:this.data[i].yPos, w:this.data[i].radius*2, h:40, r:(180/180)*Math.PI}); mcLCFunnelHolder.lineTo(xPos1, height); //For the first cone after the base of the funnel we do not draw the inner radius if (i != this.Params.numDataBelowFunnel+1) { mcLCFunnelHolder.drawFunnelWedge(this.data[i].xPos, height, 360, -180, this.data[i-1].radius, this.Constants.funnelYScale); } else { mcLCFunnelHolder.lineStyle(); mcLCFunnelHolder.drawFunnelWedge(this.data[i].xPos, height, 360, -180, this.Params.funnelBaseWidth, this.Constants.funnelYScale); if (this.Params.showBorder == 1) { mcLCFunnelHolder.lineStyle(this.data[i].borderThickness, parseInt(this.data[i].borderColor, 16), this.data[i].borderAlpha); } } mcLCFunnelHolder.lineTo(this.data[i].xPos-this.data[i].radius, this.data[i].yPos-this.data[i].height+5); mcLCFunnelHolder.drawFunnelWedge(this.data[i].xPos, this.data[i].yPos-this.data[i].height+5, 180, 180, this.data[i].radius, this.Constants.funnelYScale); mcLCFunnelHolder.endFill(); } //If a link has been defined for the funnel if (this.data[i].link == "" || this.data[i].link == undefined || this.data[i].link == null) { //Dont use a hand cursor mcLCFunnelHolder.useHandCursor = false; } else { //Set the click event handlers mcLCFunnelHolder.onRelease = function() { FIChart.linkClick(this.dataIndex); }; } //Hover Caption event handlers mcLCFunnelHolder.onRollOver = function() { FIChart.setHoverCap(this.dataIndex); }; mcLCFunnelHolder.onRollOut = function() { FIChart.removeHoverCap(this.dataIndex); }; mcLCFunnelHolder.onMouseMove = function() { FIChart.resetPositionHoverCap(); }; //Set the animation mcLCFunnelHolder._x = -(this.data[i].xPos); mcLCFunnelHolder._y = -(this.data[i].yPos); mcLCSubHolder._x = 0; mcLCSubHolder._y = 0; mcLCMainHolder._x = (this.data[i].xPos); mcLCMainHolder._y = (this.data[i].yPos); //If animation is not required if (FIChart.Params.animation == 0) { mcLCMainHolder._xscale = 100; mcLCMainHolder._yscale = 100; } else { mcLCMainHolder._yscale = 0; mcLCMainHolder._xscale = 0; } //Animation mcLCMainHolder.onEnterFrame = function() { if (this._yscale<100) { if ((this._yscale+1.5)>100) { this._yscale = 100; this._xscale = 100; } else { this._yscale += 1.5; this._xscale += 1.5; } } else { //Draw the values/names FIChart.setLabel(this.dataIndex); //Render the *raw* hover caption FIChart.renderHoverCap(); //Finally stop once the chart has been rendered delete this.onEnterFrame; } }; delete mcLCFunnelHolder; } }; Chart.prototype.drawCustomObjects = function() { //This function draws the custom objects. for (i=0; i100) { arrRatio[k] = 100; } //Sum ratioTotal += Number(arrRatio[k]); } //Total should not exceed 100 if (ratioTotal>100) { ratioTotal = 100; } //Append the rest of ratio matrix proportionally if (arrRatio.length255) { arrRatio[k] = 255; } } } //Depending upon the type of custom object draw the custom objects switch (this.customObjects[i].items[j].type.toUpperCase()) { case "LINE" : //create the empty movie clip mcObject.createEmptyMovieClip("Line_"+j, j); mcLine = eval(mcObject+".Line_"+j); mcLine.lineStyle(this.customObjects[i].items[j].thickness, parseInt(this.customObjects[i].items[j].color, 16), this.customObjects[i].items[j].alpha); mcLine.moveTo(this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos); mcLine.lineTo(this.customObjects[i].items[j].toXPos, this.customObjects[i].items[j].toYPos); break; case "TEXT" : mcObject.createEmptyMovieClip("Label_"+j, j); mcLabel = eval(mcObject+".Label_"+j); mcLabel.createText(this.customObjects[i].items[j].label, this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos, this.customObjects[i].items[j].font, this.customObjects[i].items[j].fontSize, this.customObjects[i].items[j].fontColor, this.customObjects[i].items[j].isBold, this.customObjects[i].items[j].align, this.customObjects[i].items[j].vAlign, null, true); break; case "CIRCLE" : mcObject.createEmptyMovieClip("Circle_"+j, j); mcCircle = eval(mcObject+".Circle_"+j); if (this.customObjects[i].items[j].fillAsGradient == 1) { mcCircle.beginGradientFill(this.customObjects[i].items[j].fillPattern, arrColor, arrAlpha, arrRatio, {matrixType:"box", x:this.customObjects[i].items[j].xPos-this.customObjects[i].items[j].radius, y:this.customObjects[i].items[j].yPos-(this.customObjects[i].items[j].radius), w:this.customObjects[i].items[j].radius*2, h:this.customObjects[i].items[j].radius*2, r:(this.customObjects[i].items[j].fillDegree/180)*Math.PI}); } else { mcCircle.beginFill(arrColor[0], arrAlpha[0]); } if (this.customObjects[i].items[j].showBorder == 1) { mcCircle.lineStyle(this.customObjects[i].items[j].borderThickness, parseInt(this.customObjects[i].items[j].borderColor, 16), this.customObjects[i].items[j].borderAlpha); } mcCircle.moveTo(this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos); mcCircle.drawWedge(this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos, this.customObjects[i].items[j].startAngle, this.customObjects[i].items[j].endAngle-this.customObjects[i].items[j].startAngle, this.customObjects[i].items[j].radius, this.customObjects[i].items[j].radius, 1); mcCircle._alpha = this.customObjects[i].items[j].alpha; mcCircle.endFill(); break; case "ARC" : mcObject.createEmptyMovieClip("Arc_"+j, j); mcArc = eval(mcObject+".Arc_"+j); angleDiff = Math.abs(this.customObjects[i].items[j].endAngle)-Math.abs(this.customObjects[i].items[j].startAngle); mcArc.beginFill(arrColor[0], arrAlpha[0]); if (this.customObjects[i].items[j].showBorder == 1) { mcArc.lineStyle(this.customObjects[i].items[j].borderThickness, parseInt(this.customObjects[i].items[j].borderColor, 16), this.customObjects[i].items[j].borderAlpha); } var ax = this.customObjects[i].items[j].xPos+Math.cos(this.customObjects[i].items[j].startAngle/180*Math.PI)*this.customObjects[i].items[j].radius; var ay = this.customObjects[i].items[j].yPos+Math.sin(-this.customObjects[i].items[j].startAngle/180*Math.PI)*this.customObjects[i].items[j].radius; mcArc.moveTo(ax, ay); mcArc.drawArc(this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos, this.customObjects[i].items[j].startAngle, this.customObjects[i].items[j].endAngle-this.customObjects[i].items[j].startAngle, this.customObjects[i].items[j].radius); ax = this.customObjects[i].items[j].xPos+Math.cos(this.customObjects[i].items[j].endAngle/180*Math.PI)*this.customObjects[i].items[j].innerRadius; ay = this.customObjects[i].items[j].yPos+Math.sin(-this.customObjects[i].items[j].endAngle/180*Math.PI)*this.customObjects[i].items[j].innerRadius; //If the sweep angle is more than 360, to avoid the connector line, we use the code below if (angleDiff>=360) { mcArc.lineStyle(); } mcArc.lineTo(ax, ay); if (this.customObjects[i].items[j].showBorder == 1) { mcArc.lineStyle(this.customObjects[i].items[j].borderThickness, parseInt(this.customObjects[i].items[j].borderColor, 16), this.customObjects[i].items[j].borderAlpha); } mcArc.drawArc(this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos, this.customObjects[i].items[j].endAngle, -(this.customObjects[i].items[j].endAngle-this.customObjects[i].items[j].startAngle), this.customObjects[i].items[j].innerRadius); ax = this.customObjects[i].items[j].xPos+Math.cos(this.customObjects[i].items[j].startAngle/180*Math.PI)*this.customObjects[i].items[j].radius; ay = this.customObjects[i].items[j].yPos+Math.sin(-this.customObjects[i].items[j].startAngle/180*Math.PI)*this.customObjects[i].items[j].radius; if (angleDiff>=360) { mcArc.lineStyle(); } mcArc.lineTo(ax, ay); if (this.customObjects[i].items[j].showBorder == 1) { mcArc.lineStyle(this.customObjects[i].items[j].borderThickness, parseInt(this.customObjects[i].items[j].borderColor, 16), this.customObjects[i].items[j].borderAlpha); } mcArc._alpha = this.customObjects[i].items[j].alpha; mcArc.endFill(); break; case "POLYGON" : mcObject.createEmptyMovieClip("Polygon_"+j, j); mcPoly = eval(mcObject+".Polygon_"+j); if (this.customObjects[i].items[j].fillAsGradient == 1) { mcPoly.beginGradientFill(this.customObjects[i].items[j].fillPattern, arrColor, arrAlpha, arrRatio, {matrixType:"box", x:this.customObjects[i].items[j].xPos, y:this.customObjects[i].items[j].yPos, w:(Math.abs(this.customObjects[i].items[j].toXPos-this.customObjects[i].items[j].xPos)), h:(Math.abs(this.customObjects[i].items[j].toYPos-this.customObjects[i].items[j].yPos)), r:(this.customObjects[i].items[j].fillDegree/180)*Math.PI}); } else { mcPoly.beginFill(arrColor[0], arrAlpha[0]); } if (this.customObjects[i].items[j].showBorder == 1) { mcPoly.lineStyle(this.customObjects[i].items[j].borderThickness, parseInt(this.customObjects[i].items[j].borderColor, 16), this.customObjects[i].items[j].borderAlpha); } mcPoly.drawPoly(this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos, this.customObjects[i].items[j].numSides, this.customObjects[i].items[j].radius, this.customObjects[i].items[j].startAngle); mcPoly._alpha = this.customObjects[i].items[j].alpha; mcPoly.endFill(); break; case "RECTANGLE" : mcObject.createEmptyMovieClip("Rectangle_"+j, j); mcRect = eval(mcObject+".Rectangle_"+j); if (this.customObjects[i].items[j].fillAsGradient == 1) { mcRect.beginGradientFill(this.customObjects[i].items[j].fillPattern, arrColor, arrAlpha, arrRatio, {matrixType:"box", x:this.customObjects[i].items[j].xPos, y:this.customObjects[i].items[j].yPos, w:(Math.abs(this.customObjects[i].items[j].toXPos-this.customObjects[i].items[j].xPos)), h:(Math.abs(this.customObjects[i].items[j].toYPos-this.customObjects[i].items[j].yPos)), r:(this.customObjects[i].items[j].fillDegree/180)*Math.PI}); } else { mcRect.beginFill(arrColor[0], arrAlpha[0]); } if (this.customObjects[i].items[j].showBorder == 1) { mcRect.lineStyle(this.customObjects[i].items[j].borderThickness, parseInt(this.customObjects[i].items[j].borderColor, 16), this.customObjects[i].items[j].borderAlpha); } mcRect.drawRect(this.customObjects[i].items[j].xPos, this.customObjects[i].items[j].yPos, (Math.abs(this.customObjects[i].items[j].toXPos-this.customObjects[i].items[j].xPos)), (Math.abs(this.customObjects[i].items[j].toYPos-this.customObjects[i].items[j].yPos)), this.customObjects[i].items[j].radius); mcRect._alpha = this.customObjects[i].items[j].alpha; mcRect.endFill(); break; case "IMAGE" : mcObject.createEmptyMovieClip("Image_"+j, j); mcImage = eval(mcObject+".Image_"+j); mcImage.loadMovie(this.customObjects[i].items[j].url); mcImage._alpha = this.customObjects[i].items[j].alpha; mcImage._yscale = this.customObjects[i].items[j].yScale; mcImage._xscale = this.customObjects[i].items[j].xScale; break; } } //Set the global properties for each object group mcObject._x = this.customObjects[i].xPos+_xShift; mcObject._y = this.customObjects[i].yPos+_yShift; mcObject._xscale = this.customObjects[i].xScale; mcObject._yscale = this.customObjects[i].yScale; mcObject._alpha = this.customObjects[i].alpha; } }; Chart.prototype.linkClick = function(dataIndex) { //This function navigates to a URL when a column is clicked on the chart. var linkToNav = this.data[dataIndex].link; if (linkToNav != undefined) { //We determine if a window is to be opened var strLink = new String(linkToNav); if ((strLink.CharAt(0) == "n" && strLink.CharAt(1) == "-") || (strLink.CharAt(0) == "N" && strLink.CharAt(1) == "-")) { //Means we have to open the link in a new window. //First we get the exact Link without n: finalLink = strLink.slice(2); getURL(finalLink, "_blank"); } else { //In the same window getURL(linkToNav, "_self"); } } }; Chart.prototype.renderHoverCap = function() { //This function renders the *raw* hover caption box with un-filled values //First check if Hover Caption box is required ? if (this.Params.showHoverCap == 1) { //Get the level in which hover caption will be created this.Params.hoverCapLevel = 25000+this.getLevel(); //Create the text field createTextField("ASMovHoverCaption", this.Params.hoverCapLevel, 0, 0, w, h); hoverCaption._visible = true; } }; Chart.prototype.setHoverCap = function(dataIndex) { //This function sets the position and the text values //of the hover caption box with index as the passed index if (this.Params.showHoverCap == 1) { //If hover cap is to be shown. //Create a new text-format var LHoverCapFormat = new TextFormat(); LHoverCapFormat.align = "left"; LHoverCapFormat.color = parseInt(this.Params.BaseFontColor, 16); LHoverCapFormat.font = this.Params.BaseFont; LHoverCapFormat.size = this.Params.BaseFontSize; LHoverCapFormat.leftMargin = 0; LHoverCapFormat.rightMargin = 0; //Now, make the hover caption textbox visible. ASMovHoverCaption = eval("ASMovHoverCaption"); ASMovHoverCaption._visible = true; //Set its text var sum = 0; var dsVal; //Create the text dsVal = String(this.formatNumber(Math.abs(this.data[dataIndex].value))); var strText = ""; strText = this.data[dataIndex].hoverText+this.Params.hoverCapSepChar; strText = strText+dsVal; ASMovHoverCaption.html = true; ASMovHoverCaption.htmlText = strText; ASMovHoverCaption.setTextFormat(LHoverCapFormat); ASMovHoverCaption.autoSize = true; ASMovHoverCaption.border = true; ASMovHoverCaption.borderColor = parseInt(this.Params.hoverCapBorderColor, 16); ASMovHoverCaption.background = true; ASMovHoverCaption.backgroundColor = parseInt(this.Params.hoverCapBgColor, 16); ASMovHoverCaption.multiline = true; ASMovHoverCaption.selectable = false; ASMovHoverCaption.tabEnabled = false; ASMovHoverCaption.type = "dynamic"; ASMovHoverCaption.wordWrap = false; //Set the x position if ((_xmouse+ASMovHoverCaption._width/2)>(_xShift+_chartWidth)) { ASMovHoverCaption._x = (_xShift+_chartWidth)-(ASMovHoverCaption._width)-2; } else if (_xShift>(_xmouse-(ASMovHoverCaption._width/2))) { ASMovHoverCaption._x = (_xShift)+2; } else { ASMovHoverCaption._x = _xmouse-(ASMovHoverCaption._width/2); } //Set its y pos to the current y mouse pos ASMovHoverCaption._y = _ymouse-ASMovHoverCaption._height-5; } }; Chart.prototype.removeHoverCap = function() { //This function hides the hover caption ASMovHoverCaption._visible = false; }; Chart.prototype.resetPositionHoverCap = function() { //This function re-sets the x & y co-ordinate of the Hover Cap Box if ((_xmouse+ASMovHoverCaption._width/2)>(_xShift+_chartWidth)) { ASMovHoverCaption._x = (_xShift+_chartWidth)-(ASMovHoverCaption._width)-2; } else if (_xShift>(_xmouse-(ASMovHoverCaption._width/2))) { ASMovHoverCaption._x = (_xShift)+2; } else { ASMovHoverCaption._x = _xmouse-(ASMovHoverCaption._width/2); } ASMovHoverCaption._y = _ymouse-ASMovHoverCaption._height-5; }; Chart.prototype.drawRectangle = function(depth, fromX, fromY, toX, toY, borderColor, bgColor, borderThickness, borderAlpha, bgAlpha) { //This function draws a rectangle on the canvas based on the arguments //************** PARAMETERS ****************// //depth - Level in which this rectangle will be rendered //fromX - Starting X Position //fromY - Starting Y Position //toX - Ending X Position //toY - Ending Y Position //borderColor - Border Color of the rectangle //bgColor - Background Color of the rectangle //borderThickness - Thickness of the border of the rectangle (in pixels) //borderAlpha - Alpha (Transparency) of the border //bgAlpha - Alpha (Transparency) of the background //******************************************// //Returns nothing //First, create a movie clip container //This function draws a rectangle based on the parameters passed to it. createEmptyMovieClip("ASMovRect_"+depth, depth); mcRect = eval("ASMovRect_"+depth); mcRect.beginFill(parseInt(bgColor, 16), bgAlpha); mcRect.lineStyle(borderThickness, parseInt(borderColor, 16), borderAlpha); mcRect.moveTo(fromX, fromY); mcRect.lineTo(toX, fromY); mcRect.lineTo(toX, toY); mcRect.lineTo(fromX, toY); mcRect.lineTo(fromX, fromY); mcRect.endFill(); //Clear memory resources delete mcRect; }; Chart.prototype.unescapeStr = function(str) { //This function unescapes a string, if the dataURL method is used var unStr = str; if (LboolIsURLProvided == true) { unStr = unescape(unStr); } return unStr; };  Chart ClassOO?y //Include external relevant files //Utility Functions #include "../CodeBase/FIFunctions.as" //Utility Math routines #include "../CodeBase/FIMath.as" //Color related functions #include "../CodeBase/FIColor.as" //Specialized wedge control for Funnel Chart #include "Funnel_Wedge.as" //Include the list of colors #include "../CodeBase/FIColorList.as" //Movie clip polygon #include "../CodeBase/FIMovieClip_Poly.as" //Movie clip wedge #include "../CodeBase/FIMovieClip_Wedge.as" //Movie clip rectangle #include "../CodeBase/FIMovieClip_Rect.as" //Movie clip arc #include "../CodeBase/FIMovieClip_Arc.as" //Text for annotation #include "../CodeBase/FIMovieClip_Text.as" //-----------------//  External IncludesOO?P6/* Scene Name: Chart =========================================================================== This is the main scene of the entire movie where the actual chart is rendered. In this scene, we do the following: 1. Parse the XML data document to retrieve data from it and store in our local objects 2. Do various calculations to get the co-ordinates and values for all elements of the chart. 3. Render all the visual elements of the chart. External Includes in the scene: /CodeBase/FIFunctions.as - Utility Functions /CodeBase/FIMath.as - Utility Math Functions */ DescriptionOCPicPage CPicLayer CPicFrame?8Nz//Include the external file containing routines to assist in data loading #include "../CodeBase/FIDataLoad.as" /* LboolIsURLProvided is a global scope boolean variable that would maintain the flag indicating whether the data has been provided in URL format or dataXML format. A true value indicates dataURL. */ LboolIsURLProvided = isDataURLProvided(); if (LboolIsURLProvided == false) { //If it's dataXML, send the control to FdataXMLHandler frame gotoAndPlay("FdataXMLHandler"); } else { //Else, transfer the control to FdataURLHandler frame gotoAndPlay("FdataURLHandler"); } //Stop until the scripts invoke some action stop(); ?*f//dataURL handler frame /* This frame handles the data provided via dataURL method. Here, we do the following: 1. Filter the dataURL given to us 2. Load the XML data and store it in TxmlDataDoc XML Object 3. Create the progress bar for XML data 4. If any errors are present in the XML document, show the error. */ //We've been provided with dataURL. So, the first job is to filter the dataURL provided to us. var strXMLDocURL; strXMLDocURL = filterDataURL(this.dataURL); //Text to be displayed to user while the XML data document is loading. var LXMLLoadingText = getFirstValue(unescape(this.XMLLoadingText), "Retrieving Data"); //Create the text to be displayed createText(2, LXMLLoadingText, _chartHorCenter, _chartVerCenter-(LPBarHeight/2), "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //Global flag to check whether the data size has been determined isDataSizeDetermined = false; //We now instantiate the routine to load the XML data from the specified URL. TxmlDataDoc.load(strXMLDocURL); /* We also specify the onLoad event handler for the XML document That is, the control will switch to dataLoaded() function once the data has been downloaded into the clients machine dataLoaded function is defined in FIDataLoad.as */ TxmlDataDoc.onLoad = dataLoaded; //Stop here. stop(); ?Fs//data XML handler frame /* This frame handles the data provided via data XML method. Here, we do the following: 1. Parse the XML string provided to us and store it in _global.TxmlDataDoc XML Object 2. If any errors are present in the XML document, show the error. */ //Get the parsing data text var LPParsingDataText = getFirstValue(unescape(this.ParsingDataText), "Reading Data"); //Show the parsing data text createText(2, LPParsingDataText, _chartHorCenter, _chartVerCenter-(LPBarHeight/2), "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //Parse the XML data as string var strXMLData = new String(this.data); TxmlDataDoc.parseXML(strXMLData); //Check for the validity of the data if (TxmlDataDoc.status == 0) { //if it's valid, we move to the FDataLoadFinalize frame gotoAndPlay("FDataLoadFinalize"); } else { //However if the XML Data is not well-formed, Show an error showDataError("Invalid XML Data"); } ? /* This frame is invoked when the XML data has been loaded - either via dataURL route or data XML method Here, we hide the loading text And finally, move the control to chart frame. */ //Delete the text deleteText(2); //Move to the Chart scene gotoAndPlay("Chart", 1);  ActionsO?FdataLoadInitialize /?FdataURLHandlerT?FdataXMLHandlerf?FDataLoadFinalizeGg Labels3?+t/* Scene Name: DataLoad =========================================================================== This entire scene acts as a preloader for the XML Data document. In this scene, we first check whether the XML data has been provided as an entire XML data string or only the URL of the XML provider has been given. Data can be provided to FusionCharts in 2 ways: 1. data way - The whole XML data is present in the HTML Page (Containing FusionCharts) - sort of an XML Island. 2. dataURL way - Only a URI (Uniform Resource Identifier) is provided to FusionCharts. The data source for this XML Data has been provided to us using the OBJECT/EMBED Method. Now, it's the job of FusionCharts to request XML data from that particular source. The parameter will be contained in _root.dataURL (data source URL) or _root.data (full XML data). So, first check what we've been provided with - the complete XML Data or just the data source URL. If it's the former, we parse the string and store it in our system (or display error message if the data contains an error). The actions contained in FdataXMLHandler help us do this. If it's the latter, we first filter the dataURL given to us and then we instantiate the loading of the XML document from that particular URL. Also, we show a preloader for this URL. External Includes in the scene: /CodeBase/FIDataLoad.as - Contains data loading functions. */ DescriptionOWe allow the user to take control of all those properties by specifying certain variables below. PBarTextColor - Color of the text PBarLoadingText - The actual loading text to be displayed Define local variables to store cosmetic properties */ var LPBarTextColor, LPBarLoadingText; LPBarTextColor = getFirstValue(this.PBarTextColor, "666666"); LPBarLoadingText = getFirstValue(unescape(this.PBarLoadingText), "Loading Gauge"); //If the movie is already loaded (playing from local disk or cached), just send the control to DataLoad scene if (getBytesLoaded() == getBytesTotal()) { gotoAndPlay("DataLoad", 1); } else { //If the control is here, it means the movie isn't still loaded - so, we need to build up the preloader. //Create the loading text createText(2, LPBarLoadingText, _chartHorCenter, _chartVerCenter-(LPBarHeight/2), "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //Create the preloader sequence this.onEnterFrame = function() { if (getBytesLoaded()BPage 3DataLoadB?HBPage 4ChartB@oBpXhhhhhx CColorDef3PfP0PHP`Px333(3f<03CH3F`3Hxf0f30ff(0f5Hf<`f@x3330333xf3d03]H3Z`3Xx3333303f3PPH33Px`33Px33Pf30f33PHff3(PHf3<x`f3Cxf3Ffff`f03f0ffx0fkHfd`f`x3f033fPH3ffxPH3fdx`3f]x3fZff0f3fPHfff`ffP0xffPxffPH3HfHxH̙n`hx3H33x`3fx`3xx`3̙kx3dfHf3x`ff0xfx0xf̙dxf]`3`f``x`px3`33x3fx3x3xx3nf`f3xffxfxfxxfkx3xfxxxxx3x333f333xfxf3fffffxxH3 HfH(H2`8x`3 `f`̙`(`0xx3xfxx x(xPx3H33x`f3x`3(x`35x3<3`33xf3 x̙3x3(x323x33f3 333(xfH3fx`ff0xf(0xf<xfCf`3fxffx̙fxf(xf5fx3ffff ff((xH3x`f0x̙PPP`3xfx̙P̙(P<x3f̙(xx`3xfxPxPd`3xfx̙PPx3f(xx3fxx3f̙xx3ff`zf*]h