ĐĎॹá>ţ˙  ţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙Root Entry˙˙˙˙˙˙˙˙pŞ|YŞrĎƒRASHp)˙Ě_nĹŔContents˙˙˙˙˙˙˙˙˙˙˙˙ő Page 1˙˙˙˙˙˙˙˙˙˙˙˙TMpPage 2˙˙˙˙“ý„ ý˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙ý˙˙˙˙˙˙˙ţ˙˙˙˙˙˙˙˙˙˙˙ţ˙˙˙ţ˙˙˙ ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙ ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙OPQRS–UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€Root Entry˙˙˙˙˙˙˙˙pŞ|YŞrĎƒRASH@ Ď_nĹŔContents˙˙˙˙˙˙˙˙˙˙˙˙Ş Page 1˙˙˙˙˙˙˙˙˙˙˙˙TMpPage 2˙˙˙˙˙„˙˙˙˙˙˙˙˙ ý˙˙˙ý˙˙˙˙˙˙˙ý˙˙˙˙˙˙˙ţ˙˙˙˙˙˙˙ţ˙˙˙ţ˙˙˙   !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMOPQRS–UVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹Œţ˙˙˙ ‘’ţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙™˙˙˙˙˙˙˙˙š›œŹ˙˙˙˙˙˙˙˙Ą˘Ł¤ĽŚ§¨Šţ˙˙˙Ť´­Žţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙ľśˇ¸šşťź˝ţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙‚ƒ„…†‡ˆ‰Š‹Œţ˙˙˙˙˙˙˙ ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙”•—™˜žš›œŹŸŻĄ˘Ł¤ĽŚ§¨Šţ˙˙˙˙˙˙˙˙˙˙˙­Žţ˙˙˙°ą˛łž˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙żŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôţ˙˙˙ö÷řůúűüýţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙Page 4˙˙˙˙NSymbol 5˙˙˙˙ ˙˙˙˙{Symbol 6˙˙˙˙˙˙˙˙˙˙˙˙*˙˙˙˙˙˙˙˙˙˙˙˙Page 4˙˙˙˙NSymbol 5˙˙˙˙ ˙˙˙˙{Symbol 6˙˙˙˙˙˙˙˙˙˙˙˙*˙˙˙˙˙˙˙˙˙˙˙˙Symbol 1˙˙˙˙˙˙˙˙ Symbol 2˙˙˙˙˙˙˙˙pSymbol 3 ˙˙˙˙Page 3˙˙˙˙˙˙˙˙˙˙˙˙Ž§Symbol 1˙˙˙˙˙˙˙˙ Symbol 2˙˙˙˙˙˙˙˙pSymbol 3 ˙˙˙˙Page 3˙˙˙˙˙˙˙˙˙˙˙˙Ž§ ţ˙˙˙ ţ˙˙˙ţ˙˙˙ţ˙˙˙ţ˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙ÄfA#initclip 1 #include "../CodeBase/FCProgressBar.as" #endinitclip €€ Class˙˙˙˙O€˙˙€€StartLevel; //Delete FCChart delete FCChart; //If the data is not valid - show error msg and stop if (_global.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, fal˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame˙˙CPicText€€ ń˙˙;ţ˙˙˙ƒ˙ embedText !@#$%^&*()@Verdana˙"(€€˙˙˙?˙˙Ü €€ Layer 1˙˙˙˙O€˙˙€€˙˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€˙˙˙?˙˙˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€˙˙˙?˙˙A€€€˙˙˙?˙˙JavaScriptHandlerM˙Ĺ//This frame responds to JavaScript data. //First, we check if new data has been actually supplied if (_root.isNewData == "1" && (_root.newData != undefined && _root.newData != null)) { //Means new data has been supplied //Get the new data _global.TxmlDataDoc = new XML(); _global.TxmlDataDoc.parseXML(_root.newData); //Now, clear the chart objects already rendered (with depth starting from this.Params.chartStartLevel to FCLastLevel) 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 //(typeof (obj) == "movieclip") && if ((obj.getDepth()<=_global._FCLastLevel) && (obj.getDepth()>=FCChart.Params.chartStartLevel)) { obj.removeMovieClip(); deleteText(obj.getDepth()); } delete obj; } //Re-set the global counter _global._FCLastLevel = FCChart.Params.chartStartLevel; //Delete FCChart delete FCChart; //If the data is not valid - show error msg and stop if (_global.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(); } €€€˙˙˙?˙˙ ErrorStopa//Just stop stop();€€ JavaScript Handler˙˙˙˙O˙O˙€€€€˙˙˙?˙˙V3˙/* 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 */ LNoDataText = getFirstValue(unescape(_root.ChartNoDataText), "No data to display."); //Next, we instantiate an object representing the chart class FCChart = new Chart(); //Acquire the data from the global XML document FCChart.acquireData(); //Parse the data into the Chart arrays and variables. FCChart.parseData(); //Now, if there is no data to display if (FCChart.Params.num == 0 || FCChart.Params.sumOfValues == 0) { //Display the no data text createText(1, LNoDataText, _chartHorCenter, _chartVerCenter, "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //And stop stop(); } else { //Now, if we've data to display then carry on. //Calculate the co-ordinates of various elements on the chart FCChart.calculatePoints(); //Move to the next frame. play(); } €€€˙˙˙?˙˙StartĆ,˙E/* 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 "Renderin˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€Ě3˙óf˙˙VŘ0Š÷%S— €€˙˙˙?˙˙€€ Layer 1˙˙˙˙O€˙˙˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame˙˙CPicText€€ ń˙˙;ţ˙˙˙ƒß embedText@Verdana˙"(€€˙˙˙?˙˙က Layer 1˙˙˙˙O€˙˙€€˙˙˙˙,5˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€ĚĚ˙ó¸ŕü 0Hĺ0ŕü0¸˙˙˙?˙˙"€€ Loader˙˙˙˙O€˙˙€€(#Xhhhh€€˙ł g Chart" textbox deleteText(1); //Also, delete the size calculate movie clip deleteText(25001); //Render the background FCChart.drawBackground(); //Load Bacgkround swf FCChart.loadBgSWF(); //Set the labels on the chart FCChart.setLabels(); //Create the chart FCChart.renderChart(); //Render the *raw* hover caption FCChart.renderHoverCap(); //Now, if no animation is to be done, just stop if (FCChart.Params.animation==0) { stop(); } else { //Now do the animation part pieIndexVisible = 0; currentDataIndex = 1; play(); }€€€˙˙˙?˙˙MidŰk˙‘//Increase the index pieIndexVisible++; //Set the shadow and the slice visible mcPie = eval("Pie_Shadow_"+pieIndexVisible); mcPie._visible = true; mcPie = eval("Pie_"+pieIndexVisible); mcPie._visible = true; //Set name if (pieIndexVisible>FCChart.data[currentDataIndex].cumAngle) { //Set the name FCChart.setNames(currentDataIndex); //Increment currentDataIndex++; } //Delete object delete mcPie; €€€˙˙˙?˙˙FinalxŒ//If all the doughnut slices have not been drawn, draw if (pieIndexVisible<=360) { gotoAndPlay("Mid"); } else { //Finally stop stop(); } €€ Actions˙˙˙˙˙OO˙€€€€˙˙˙?˙˙ČO˙żj//** Chart Class **// //Chart is the base object on which the whole charting model will be based _global.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(); //Angles array this.angles = 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(); //** Set the data/properties of a few objects **/ //Params.num indicates the number of data sets passed to the graph this.Params.num = 0; //Sum of values this.Params.sumOfValues = 0; //Some constants to be used throughout the movie this.Constants.calcTextXPos = Number(getFirstValue(_root.calcTextXPos, "-200")); this.Constants.calcTextYPos = Number(getFirstValue(_root.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) { //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; //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; //cumValue - Cumulative Value this.cumValue = 0; //cumAngle - Cumulative Angle this.cumAngle = 0; this.labelAngle = 0; //percentValue - Percentage Value this.percentValue = 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; }; //** Methods **// Chart.prototype.acquireData = function() { //This function acquires the data from the global XML object //into the Chart class this.xmlData = _global.TxmlDataDoc; //Delete the global object to free up memory resources delete _global.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 if (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; //Chart Title this.Params.caption = getFirstValue(levelOneNodes[i].attributes.caption, ""); this.Params.subCaption = getFirstValue(levelOneNodes[i].attributes.subCaption, ""); //If no caption has been provided, set an appropriate flag //Default flag this.Params.showCaption = 1; if (this.Params.caption == "") { this.Params.showCaption = 0; } this.Params.showSubCaption = 1; if (this.Params.subCaption == "") { this.Params.showSubCaption = 0; } //Configuration to set whether to show the names or not this.Params.showNames = Number(getFirstValue(levelOneNodes[i].attributes.showNames, "0")); this.Params.showValues = Number(getFirstValue(levelOneNodes[i].attributes.showValues, "1")); this.Params.showPercentageValues = Number(getFirstValue(levelOneNodes[i].attributes.showPercentageValues, "1")); this.Params.showPercentageInLabel = Number(getFirstValue(levelOneNodes[i].attributes.showPercentageInLabel, "0")); //Shadow this.Params.showShadow = Number(getFirstValue(levelOneNodes[i].attributes.showShadow, "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")); //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")); this.Params.pieRadius = levelOneNodes[i].attributes.pieRadius; this.Params.pieBorderThickness = Number(getFirstValue(levelOneNodes[i].attributes.pieBorderThickness, "2")); this.Params.pieBorderAlpha = Number(getFirstValue(levelOneNodes[i].attributes.pieBorderAlpha, "75")); this.Params.pieFillAlpha = Number(getFirstValue(levelOneNodes[i].attributes.pieFillAlpha, "45")); this.Params.slicingDistance = Number(getFirstValue(levelOneNodes[i].attributes.slicingDistance, "10")); this.Params.shadowColor = formatHexColor(getFirstValue(levelOneNodes[i].attributes.shadowColor, "B9B9B9")); //Text Gap between the pie end and the names this.Params.nameTBDistance = Number(getFirstValue(levelOneNodes[i].attributes.nameTBDistance, "12")); //Number prefix and suffix this.Params.numberPrefix = getFirstValue(this.unescapeStr(levelOneNodes[i].attributes.numberPrefix), ""); this.Params.numberSuffix = getFirstValue(this.unescapeStr(levelOneNodes[i].attributes.numberSuffix), ""); //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, "1")); //Decimal Precision cannot be less than 0 - so adjust it if (this.Params.decimalPrecision<0) { this.Params.decimalPrecision = 0; } //Radar Radius this.Params.animation = Number(getFirstValue(levelOneNodes[i].attributes.animation, "1")); //Chart Margins this.Params.chartLeftMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartLeftMargin, "8")); this.Params.chartRightMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartRightMargin, "8")); this.Params.chartTopMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartTopMargin, "15")); //If the legend is not to be shown, not much of a need for bottom margin this.Params.chartBottomMargin = Number(getFirstValue(levelOneNodes[i].attributes.chartBottomMargin, "15")); //All the properties have been extracted //Therefore, now we move on to extract the data contained in CATEGORIES, DATA and TRENDLINES nodes 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+setValue; var setLink = unescape(levelTwoNodes[j].attributes.link); var setName = getFirstValue(levelTwoNodes[j].attributes.name, ""); var setHoverText = getFirstValue(levelTwoNodes[j].attributes.hoverText, setName); var setAlpha = Number(getFirstValue(levelTwoNodes[j].attributes.alpha, this.Params.pieFillAlpha)); var setColor = formatHexColor(getFirstValue(levelTwoNodes[j].attributes.color, pieDefaultColors[this.Params.num%pieDefaultColors.length])); //Create the object to represent it this.data[this.Params.num] = new Chart.dataItem(setName, setValue, setColor, setLink, setAlpha, setHoverText); } } //Free memory resource delete setNodes; } } //Now, remove the unwanted data/objects from memory delete levelTwoNodes; delete levelOneNodes; }; Chart.prototype.calculatePoints = function() { //This function calculates the pixel co-ordinates of all the elements on the chart. //We first assume the canvas height to be of the same size as the stage height //The canvas height for a pie chart refers to the maximum available space for the pie //Step by step, we'll now deduct the margins and elements height to get the actual height var LCanvasHeight = _chartHeight; var LCanvasWidth = _chartWidth; var LCanvasStartX, LCanvasEndX, LCanvasStartY, LCanvasEndY; var verticalBlockedHt = 0; var horizontalBlockWd = 0; //Deduct the top and bottom margins LCanvasHeight = LCanvasHeight-(this.Params.chartTopMargin+this.Params.chartBottomMargin); verticalBlockedHt = this.Params.chartTopMargin; //Now, if the caption is to be shown, deduct the height of the caption var LCaption; if (this.Params.showCaption == 1) { LCaption = createText(25001, this.Params.caption, this.Constants.calcTextXPos, this.Constants.calcTextYPos, this.Params.baseFont, this.Params.baseFontSize, this.Params.baseFontColor, true, "center", "center", null, true); //Create an object in this.objects representing this caption object this.objects.caption = new Chart.cObject(_FCXShift, _FCYShift+verticalBlockedHt+(LCaption.textHeight/2), LCaption.textHeight, LCaption.textWidth); //Add to blocked height and canvas size LCanvasHeight = LCanvasHeight-LCaption.textHeight; verticalBlockedHt = verticalBlockedHt+LCaption.textHeight; } //Space for sub caption if (this.Params.showSubCaption == 1) { LCaption = createText(25001, this.Params.subCaption, this.Constants.calcTextXPos, this.Constants.calcTextYPos, this.Params.baseFont, this.Params.baseFontSize, this.Params.baseFontColor, true, "center", "center", null, true); //Create an object in this.objects representing this caption object this.objects.subCaption = new Chart.cObject(_FCXShift, _FCYShift+verticalBlockedHt+(LCaption.textHeight/2), LCaption.textHeight, LCaption.textWidth); //Add to blocked height and canvas size LCanvasHeight = LCanvasHeight-LCaption.textHeight; verticalBlockedHt = verticalBlockedHt+LCaption.textHeight; } var pieRadius, pieVerticalSpacing; //Vertical Spacing - initially set it to the original canvas height pieVerticalSpacing = LCanvasHeight; //Calculate the pie radius //equivalent to 65% of canvas height if names are to be shown if (this.Params.showNames == 1) { pieRadius = (0.65*LCanvasHeight)/2; } else { //Else 85 percent pieRadius = (0.85*LCanvasHeight)/2; } //Now, re-set this.Params.pieRadius = Number(getFirstValue(this.Params.pieRadius, pieRadius)); //Re-calculate the canvas height based on re-adjusted radar radius LCanvasHeight = this.Params.pieRadius*2; //Re-set the vertical spacing pieVerticalSpacing = (pieVerticalSpacing-LCanvasHeight)/2; //Ignore if negative if (pieVerticalSpacing<0) { pieVerticalSpacing = 0; } //Start Y LCanvasStartY = _FCYShift+verticalBlockedHt; //Calculate the end Y of the canvas LCanvasEndY = LCanvasStartY+LCanvasHeight; //Now, settings for width LCanvasWidth = LCanvasHeight; LCanvasStartX = _FCXShift+(_chartWidth-LCanvasWidth)/2; LCanvasEndX = LCanvasStartX+LCanvasWidth; //Create the pie object this.Objects.pie = new Chart.cObject(LCanvasStartX+(LCanvasWidth/2), LCanvasStartY+(LCanvasHeight/2)+pieVerticalSpacing, this.Params.pieRadius, this.Params.pieRadius); //Calculate the angles for each of the values var perAngleValue = 360/this.Params.sumOfValues; var donutScale = (this.Params.pieRadius); this.Params.donutScale = donutScale; //Calculate the cumulative value for each pie. for (i=1; i<=this.Params.Num; i++) { this.data[i].cumValue = Number(this.data[i-1].cumValue)+this.data[i].value; //Also, get the formatted percent value this.data[i].percentValue = (this.data[i].value/this.Params.sumOfValues)*100; } //Now calculate the cumulative angle for (i=1; i<=this.Params.num; i++) { this.data[i].cumAngle = Math.ceil(this.data[i].cumValue*perAngleValue); } //Set initial to 0 this.data[0] = new Chart.dataItem("", 0, "", "", 0, 0); this.data[0].cumAngle = 0; //We calculate the position of the various elements on the chart //------------------------------------------------------------// for (i=1; i<=this.Params.num; i++) { //Calculate the bisected angle var bisectedAngle = (this.data[i-1].cumAngle+((this.data[i].cumAngle-this.data[i-1].cumAngle)/2)); this.data[i].xPos = this.Objects.pie.xPos; this.data[i].yPos = this.Objects.pie.yPos; //Get the value tb position var tmpPoint; tmpPoint = Math.calculatePoint(this.data[i].xPos, this.data[i].yPos, this.Params.pieRadius+this.Params.nameTBDistance, bisectedAngle); this.data[i].valueTbXPos = tmpPoint.x; this.data[i].valueTbYPos = tmpPoint.y; } }; Chart.prototype.formatNumber = function(number, appendPreSuff) { //This function formats a number in FusionCharts format //If no appendPreSuff if (appendPreSuff == undefined || appendPreSuff == null) { //By default assume that we have to append appendPreSuff = true; } var intNum = number; var strScale = ""; //If number is to be scaled if (this.Params.formatNumberScale == 1) { if (Math.abs(intNum)>=1000) { strScale = "K"; intNum = intNum/1000; } if (Math.abs(intNum)>=1000) { strScale = "M"; intNum = intNum/1000; } } //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, this.Params.decimalPrecision); //Format the commas in the number strNum = formatCommas(String(strNum), this.Params.thousandSeparator, this.Params.decimalSeparator); } strNum = strNum+strScale; //Now, we append the prefix and the suffix if (appendPreSuff) { strNum = this.Params.numberPrefix+strNum+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 _global._FCLastLevel++; //Return it return _global._FCLastLevel; }; //**** Chart Element Rendering Methods ****// Chart.prototype.drawBackground = function() { //This function renders the background of the chart var level = this.getLevel(); //Set start level index this.Params.chartStartLevel = level; this.drawRectangle(this.getLevel(), _FCXShift, _FCYShift, _FCXShift+_chartWidth, _FCYShift+_chartHeight, this.Params.bgColor, this.Params.bgColor, 0, 0, this.Params.bgAlpha); }; Chart.prototype.loadBgSWF = function() { //This function loads the background chart swf file //First create a container movie clip createEmptyMovieClip("ASMov_bgSWF", this.getLevel()); //Get a reference to the same mcbgSWF = eval("ASMov_bgSWF"); //Load the external movie mcbgSWF.loadMovie(this.Params.bgSWF); }; Chart.prototype.setLabels = function() { //This function sets the various labels on the chart //Render the chart caption if (this.Params.showCaption == 1) { createText(this.getLevel(), this.Params.caption, this.Objects.pie.xPos, this.Objects.Caption.yPos, this.Params.baseFont, this.Params.baseFontSize, this.Params.baseFontColor, true, "center", "center", null, true); } if (this.Params.showSubCaption == 1) { createText(this.getLevel(), this.Params.subCaption, this.Objects.pie.xPos, this.Objects.subCaption.yPos, this.Params.baseFont, this.Params.baseFontSize, this.Params.baseFontColor, true, "center", "center", null, true); } }; Chart.prototype.setNames = function(dataIndex) { //Set the labels now var dspValue = ""; if (this.data[dataIndex].value != 0) { //If the name is to be shown if (this.Params.showNames == 1) { dspValue = dspValue+this.data[dataIndex].name; } //separator char if (this.Params.showNames == 1 && this.Params.showValues == 1) { dspValue = dspValue+this.Params.hoverCapSepChar; } //If values are to be shown if (this.params.showValues == 1) { //if percentage values are to be shown if (this.Params.showPercentageInLabel == 1) { dspValue = dspValue+String(this.formatNumber(this.data[dataIndex].percentValue, false))+"%"; } else { dspValue = dspValue+this.formatNumber(this.data[dataIndex].value); } } //Calculate the label angles for each of the pie for (j=1; j<=this.Params.num; j++) { this.data[j].labelAngle = this.data[j-1].cumAngle+(this.data[j].cumAngle-this.data[j-1].cumAngle)/2; } var horAlign; //Now, create the textboxes for the labels if (this.data[dataIndex].labelAngle>90 && this.data[dataIndex].labelAngle<270) { horAlign = "right"; } else if (this.data[dataIndex].labelAngle>270 || this.data[dataIndex].labelAngle<90) { horAlign = "left"; } //Now, if the label angle falls exactly between 80-100 or 260-280, we set it to center align if ((this.data[dataIndex].labelAngle>80 && this.data[dataIndex].labelAngle<100) || (this.data[dataIndex].labelAngle>260 && this.data[dataIndex].labelAngle<280)) { horAlign = "center"; } //Create the text createText(this.getLevel(), dspValue, this.data[dataIndex].valueTbXPos, this.data[dataIndex].valueTbYPos, this.Params.baseFont, this.Params.baseFontSize, this.Params.baseFontColor, false, horAlign, "center", null, true); dspValue = ""; } }; Chart.prototype.renderChart = function() { //This function actually does the work of rendering the pies //First render the shadow //For this we run a loop for this.Params.Num and then render the pies for each segment for (i=1; i<=this.Params.Num; i++) { //To accomodate 0 values if (this.data[i-1].cumAngle != this.data[i].cumAngle) { for (j=this.data[i-1].cumAngle; j<=this.data[i].cumAngle; j++) { //First, we create the pie shadow if (this.Params.showShadow == "1") { //Duplicate the pie attachMovie("MovPie", "Pie_Shadow_"+j, this.getLevel()); //Get a reference to pie mcPie = eval("Pie_Shadow_"+j); //Set its x & y position mcPie._x = this.data[i].xPos+5; mcPie._y = this.data[i].yPos+5; //Set its x and y scale mcPie._xscale = this.Params.donutScale; mcPie._yscale = this.Params.donutScale; //Set its rotation mcPie._rotation = -j; //Set its color clrPie = new Color(mcPie); clrPie.setRGB(parseInt(this.Params.shadowColor, 16)); //If animation is to be done, hide the slice if (this.Params.animation == 1) { mcPie._visible = false; } delete mcPie; } } } } //Render the actual pie now for (i=1; i<=this.Params.Num; i++) { //To accomodate 0 values if (this.data[i-1].cumAngle != this.data[i].cumAngle) { for (j=this.data[i-1].cumAngle; j<=this.data[i].cumAngle; j++) { //Duplicate the pie attachMovie("MovPie", "Pie_"+j, this.getLevel()); //Get a reference to pie mcPie = eval("Pie_"+j); //Set its x & y position mcPie._x = this.data[i].xPos; mcPie._y = this.data[i].yPos; //Set its x and y scale mcPie._xscale = this.Params.donutScale; mcPie._yscale = this.Params.donutScale; //Set its rotation mcPie._rotation = -j; //Set its color clrPie = new Color(mcPie); clrPie.setRGB(parseInt(this.data[i].color, 16)); //Convey the dataIndex mcPie.dataIndex = i; //------------EVENT HANDLERS FOR THE PIE-------------// //If a link has been defined for the pie if (this.data[i].link == "" || this.data[i].link == undefined || this.data[i].link == null) { //Dont' use a hand cursor mcPie.useHandCursor = false; } else { //Set the click event handlers mcPie.onRelease = function() { FCChart.linkClick(this.dataIndex); }; } //Hover Caption event handlers mcPie.onRollOver = function() { FCChart.setHoverCap(this.dataIndex); }; mcPie.onRollOut = function() { FCChart.removeHoverCap(this.dataIndex); }; //If animation is to be done, hide the slice if (this.Params.animation == 1) { mcPie._visible = false; } delete mcPie; } //If no animation required, set name if (this.Params.animation == 0) { this.setNames(i); } } } }; 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 //If percentage numbers to be shown if (this.Params.showPercentageValues == 1) { dsVal = String(this.formatNumber(this.data[dataIndex].percentValue, false))+"%"; } else { dsVal = this.formatNumber(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 //Set the x position if ((_xmouse+(ASMovHoverCaption._width/2))>(_FCXShift+_chartWidth)) { ASMovHoverCaption._x = (_FCXShift+_chartWidth)-(ASMovHoverCaption._width)-2; } else if (_FCXShift>(_xmouse-(ASMovHoverCaption._width/2))) { ASMovHoverCaption._x = (_FCXShift)+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 y co-ordinate of the Hover Cap Box if ((_xmouse+(ASMovHoverCaption._width/2))>(_FCXShift+_chartWidth)) { ASMovHoverCaption._x = (_FCXShift+_chartWidth)-(ASMovHoverCaption._width)-2; } else if (_FCXShift>(_xmouse-(ASMovHoverCaption._width/2))) { ASMovHoverCaption._x = (_FCXShift)+2; } else { ASMovHoverCaption._x = _xmouse-(ASMovHoverCaption._width/2); } ASMovHoverCaption._y = _ymouse-ASMovHoverCaption._height-5; }; //**** General Methods *****// /* General methods are those methods which can be used with any other Flash movies for some common jobs like font rendering, shapes drawing etc. */ 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 rec˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€˙˙˙?˙˙xX˙//Include the external file containing routines to assist in data loading #include "../CodeBase/FCDataLoad.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. */ _global.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();€€€˙˙˙?˙˙6k˙Ó//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 _global.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(_root.dataURL); //Text to be displayed to user while the XML data document is loading. var LXMLLoadingText = getFirstValue(unescape(_root.XMLLoadingText), "Retrieving Data. Please Wait"); //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 _global.isDataSizeDetermined = false; //Now, create the progress bar for XML data loading attachMovie("FCProgressBar", "FCPB", 1); FCPB.setPosition(_chartHorCenter-(LPBarWidth/2), _chartVerCenter); FCPB.setSize(LPBarWidth, LPBarHeight); FCPB.setColors(LPBarBgColor, LPBarBorderColor); FCPB.setBorderThickness(LPBarBorderThickness); FCPB.draw(); //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 FCDataLoad.as */ TxmlDataDoc.onLoad = dataLoaded; //Create the onEnter Frame action _root.onEnterFrame = function() { //If the total bytes of the XML document has been detected, //we set the minimum and maximum limits for the progress bar //and update the value. if (_global.TxmlDataDoc.getBytesTotal() != undefined && _global.TxmlDataDoc.getBytesTotal()>0) { if (_global.isDataSizeDetermined == false) { //Set the new limits of the progress bar FCPB.setLimits(0, _global.TxmlDataDoc.getBytesTotal()); //Update the flag _global.isDataSizeDetermined = true; } /˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€˙˙˙?˙˙r€˙˙ CPicSpriteúě˙˙ˇú˙˙ úě˙˙ˇú˙˙d˙ MovLoaderBg€ü˙˙ňř˙˙ ü˙˙ňř˙˙d˙?w MovEmbedText€€˙˙˙?˙˙Ë€€ Physical Objects˙˙˙˙™3Ě˙€€€€˙˙˙?˙˙€€€˙˙˙?˙˙ FStartLoad„€€€˙˙˙?˙˙FLoading+€€€˙˙˙?˙˙ FLoadingChecku€€€˙˙˙?˙˙FXMLLoad3€€€˙˙˙?˙˙ FXMLLoadinge7€€€˙˙˙?˙˙ FXMLChecky€€€˙˙˙?˙˙FXMLDone(k€€ Labels˙˙˙˙O˙O˙€€€€˙˙˙?˙˙aD˙Ł//In this frame, we do the following: /* 1. Configure the movie for dynamic re-sizing 2. Configure the movie for multi-lingual characters */ //Initialization Actions //Set the properties of Stage to enable dynamic re-sizing Stage.scaleMode = "noScale"; Stage.align = "TL"; //Multi-lingual Feature /* To include or load XML data files that are not Unicode-encoded, we set system.useCodepage to true. The Flash Player will now interpret the XML file using the traditional code page of the operating system running the Flash Player. This is generally CP1252 for an English Windows operating system and Shift-JIS for a Japanese operating system. */ System.useCodePage = true; €€€˙˙˙?˙˙Ék˙0&//In this frame, we do the following things: /* 1. Get the chart to load the XML Data. For this, we'll first have to filter the data URL source that has been specified. 2. Create the pre-loader init scripts */ //--------------------------------// //** Load XML Data Document **// //--------------------------------// // :Explanation: Ways to load the XML data /* Here, we'll load the XML document into the previously created temporary XML object (_global.TxmlDataDoc) (declared in Layer Functions/Constants > Frame 1). Data can be provided to FusionCharts in 2 ways: 1. dataXML 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.dataXML (full XML data). So, first check what we've been provided with - the complete XML Data or just the data source URI We'll first Declare some Local variables that we'll be using: - LboolIsURLProvided is a boolean variable that would maintain the flag indicating whether the data has been provided in URL format or dataXML format. By default, we assume that we have been provided the dataURL */ var LboolIsURLProvided = true; //We copy the contents of _root.dataurl into a variable called LstrXMLDocURL var LstrXMLDocURL = _root.dataURL; // :Explanation: How the source of data is determined? /* We now check whether it was the data url that was provided to us or the complete data xml. The check is based on the length of dataURL. If it's a 0 length string, it means we're either provided with dataXML or nothing has been provided. If nothing has been provided, we assume the dataURL to be a default data file (data.xml). */ if (LstrXMLDocURL.length<1) { //Since the length of dataURL is less than 1 //We haven't been provided with dataURL if (_root.dataXml == "" || _root.dataXml == null || _root.dataXml == undefined) { //Now, if we haven't been provided with dataXML also. //We set the data URI to a default data file (as set in Layer Functions/Constants > Frame 1) LstrXMLDocURL = _defaultDataFile; } else { //We have been provided with the full XML document //So, we re-set the flag LboolIsURLProvided = false; } } // :Explanation: In case of dataURL, how the URL is filtered? /* Now, if dataURL has been provided to us, we need to filter it before we can invoke the XML request. The filter involves the following jobs: 1. Convert the URL Encoded dataURL back to normal form. 2. If not working in local mode, we'll append the time at the end of the dataURL so that a new XML document is sent by the server for each request and the XML data is not cached. Suppose, the dataURL is data.asp, so we'll convert it to data.asp?curr=43743 so that we can fool the server and get new data every time we request for it. */ //** Step 1 of Filtering process: Unescape (HTML Encode the URL Encoded variables)// if (LboolIsURLProvided == true) { //Now, if there are *s present in the URL, we convert it to a normal link (backward version compatibility) if (LstrXMLDocURL.indexOf("*") != -1) { //Get the URL with * xmlDocUrl = new String(LstrXMLDocURL); //Use the split function of array to split the URL wherever a * is found var arrUrl = new Array(); arrUrl = xmlDocUrl.split("*"); var finUrl = ""; //Now, join them depending on their position for (loopvar=0; loopvar Frame 1), we will add a continuously updating data (number of milliseconds that have elapsed since the movie started playing) at the end of the dataURL. This will result in having a new dataURL every time we need to get the data from the server and therefore the server will be "fooled" thereby passing on updated data each time. We add the time in the format ?curr=xxxxx or &curr=xxxxx depending on whether there's already a ? present in the dataURL or not. That is, if filtered dataURL is data.asp?param1=value1, then we add curr as data.asp?param1=value1&curr=xxxxx. However, if dataURL is simply data.asp, we add curr as data.asp?curr=xxxxx */ LstrFilteredURL = LstrXMLDocURL; if (LboolIsURLProvided == true && _isOnline) { //Do this only if we are dealing with dataURL and we are working online if (LstrFilteredURL.indexOf("?") == -1) { //If a ? exists in the data url LstrFilteredURL = LstrFilteredURL+"?curr="+getTimer(); } else { //If a ? does NOT exist in the data url LstrFilteredURL = LstrFilteredURL+"&curr="+getTimer(); } } //We now have a filtered data URL in the variable LstrFilteredURL /* We'll now load the XML document based on either dataURL or dataXML - whatever has been supplied to us. */ if (LboolIsURLProvided == true) { //If we have been supplied with dataURL _global.TxmlDataDoc.load(LstrFilteredURL); //We also specify the onLoad event handler for the XML document //That is the control will switch to xmlLoaded() function once the data //has been downloaded into the clients machine _global.TxmlDataDoc.onLoad = xmlLoaded; } else { //If the complete data has been specified as dataML var LstrDirectXml = new String(_root.dataXml); _global.TxmlDataDoc.parseXML(LstrDirectXml); } //The data is now being loaded into _global.TxmlDataDoc //So, we move onto the movie preloader part //--------------------------------// //** Movie Preloader BEGIN **// //--------------------------------// //Chart Pre-loader Initialization scripts //Initialize local variables relating to the pre-loader var LPBarHeight, LPBarWidth, LPBarBorderColor, LPBarBgColor, LPBarTextColor; //Define Pre-loader Progress bar Height LPBarHeight = Number(getFirstValue(_root.PBarHeight, "15")); //Calculate the width of the progress bar // :Explanation: How the width of the progress bar is being calculated? /* Basically, what we are aiming to do here is - Center align the progress bar elements with respect to the chart size. So, the width of the progress bar is set in such a way that is the chart width is greater than 200 pixels, the progress bar width will be 150 pixels. However, if the chart width is less than 200 pixels, then the progress bar width will be 25 pixels less than the chart width. */ LPBarWidth = (_chartWidth>200) ? 150 : (_chartWidth-25); /* We also give the user an option to strong-enforce his own progress bar width value in case he wants something on his own. */ LPBarWidth = getFirstValue(_root.PBarWidth, LPBarWidth); /* We let the user specify border color, background color, and text color of the progress bar in case he wants to change the default values We also let him specify the text that would appear while the data is loading */ LPBarBorderColor = getFirstValue(_root.PBarBorderColor, "E2E2E2"); LPBarBgColor = getFirstValue(_root.PBarBgColor, "E2E2E2"); LPBarTextColor = getFirstValue(_root.PBarTextColor, "666666"); LPBarLoadingText = getFirstValue(unescape(_root.PBarLoadingText), "Loading Chart. Please Wait"); LXMLLoadingText = getFirstValue(unescape(_root.XMLLoadingText), "Retrieving Data. Please Wait"); //We now draw the border of the progress bar at the center of the stage createEmptyMovieClip("ASMovPBorder", 10); mcPBorder = eval("ASMovPBorder"); //Set the line style of the border mcPBorder.lineStyle(1, parseInt(LPBarBorderColor, 16), 100); mcPBorder.moveTo(_chartHorCenter-(LPBarWidth/2), _chartVerCenter-(LPBarHeight/2)); mcPBorder.lineTo(_chartHorCenter+(LPBarWidth/2), _chartVerCenter-(LPBarHeight/2)); mcPBorder.lineTo(_chartHorCenter+(LPBarWidth/2), _chartVerCenter+(LPBarHeight/2)); mcPBorder.lineTo(_chartHorCenter-(LPBarWidth/2), _chartVerCenter+(LPBarHeight/2)); mcPBorder.lineTo(_chartHorCenter-(LPBarWidth/2), _chartVerCenter-(LPBarHeight/2)); delete mcPBorder; /* We now set the x, y co-ordinates and width and height of MovLoaderBg Clip MovLoaderBg movie clip instance is the movie clip which would act as the "filler" for the progress bar. That is to say, it would change it's own width representing the percentage of movie loaded. */ MovLoaderBg._x = _chartHorCenter-(LPBarWidth/2); MovLoaderBg._y = _chartVerCenter+(LPBarHeight/2); /* We set the initial width to 0 - to represent that the movie has just started to load. The height of the bar would be the same as that of the progress bar border. We also re-set the color of the bar. */ MovLoaderBg._width = 0; MovLoaderBg._height = LPBarHeight; clrMovLoaderBg = new Color("MovLoaderBg"); clrMovLoaderBg.setRGB(parseInt(LPBarBgColor, 16)); /* We now create a text message to show the loading text. */ createText(1, LPBarLoadingText, _chartHorCenter, _chartVerCenter-(LPBarHeight/2), "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //*** Pre-loader start ***// var bytesLoaded, bytesTotal; //We get the total size of the movie in bytes. bytesTotal = this.getBytesTotal(); //We also get the size of the movie that has been loaded (upto this moment) into the viewer's machine bytesLoaded = this.getBytesLoaded(); //Keep on playing play(); €€€˙˙˙?˙˙ĹXB//This frame is a part of the preloader script //Just play play();€€€˙˙˙?˙˙ç2˙K//This frame is a part of the preloader script //Here, we check the movie has been fully downloaded to the end user's machine. if (bytesLoaded=270) { switch (vAlignPos.toUpperCase()) { case "LEFT" : fcText._x = fcText._x; break; case "CENTER" : fcText._x = fcText._x-(fcText._width/2); break; case "RIGHT" : fcText._x = fcText._x-(fcText._width); break; } } else { switch (vAlignPos.toUpperCase()) { case "LEFT" : fcText._x = fcText._x+(fcText._width); break; case "CENTER" : fcText._x = fcText._x+(fcText._width/2); break; case "RIGHT" : fcText._x = fcText._x; break; } } } //Set 4 properties of the temporary object //textWidth, textHeight, textX, textY //These properties will be returned to the caller function. //for text manipulation LTextProperties.textWidth = fcText._width; LTextProperties.textHeight = fcText._height; //For fonts not included if (LTextProperties.textHeight<=4) { LTextProperties.textHeight = fontSize*2; } LTextProperties.textX = fcText._x; LTextProperties.textY = fcText._y; //Return this object return LTextProperties; //Delete the temporary objects delete LTextProperties; delete fcTextFormat; delete fcText; }; _global.deleteText = function(depth) { //This function deletes a text box created using createText //Get a reference to the textbox mcText = eval("ASMovText_"+depth); //Remove it mcText.removeTextField(); //Delete the reference delete mcText; }; //Next, we initialize the chart by setting the required width and height of the chart _global._chartWidth = Number(getFirstValue(_root.chartWidth, "350")); _global._chartHeight = Number(getFirstValue(_root.chartHeight, "350")); /* defaultDataFile represents the XML data file URI which would be loaded if no other URI or XML data has been provided to us. */ _global._defaultDataFile = getFirstValue(unescape(_root.defaultDataFile), "Data.xml"); //A temporary XML object now to load the XML data until the chart is loaded //We will later transfer the contents of this temporary XML object to our Chart Class // :Explanation: Why use this temporary XML Object? /* We have intentionally created this temporary XML Object to load the data from the XML Source. Since, we have defined our chart class in the next scene (Chart Scene) and this scene will be played only when the chart is loaded. So, while the chart swf file is loading, we also instantiate a request to load the XML data. This eliminates the time the user might have to wait for data loading after chart loading. */ _global.TxmlDataDoc = new XML(); /* FCLastLevel is a variable used to keep track of the number of levels used up for rendering the chart. We use the rendering algorithm of Flash to order the z-axis-index of various elements of the chart. Initially, it is set to 1 (or _global._FCLastLevel as set in loader movie) as we haven't rendered any element as yet. */ FCLastLevel = Number(getFirstValue(_root.FCLastLevel, 1)); /* _FCXShift and _FCYShift refers to the initial x and y position for the chart. Basically, these parameters would be used when loading the chart inside other Flash movies */ _FCXShift = Number(getFirstValue(_root._FCXShift, 0)); _FCYShift = Number(getFirstValue(_root._FCYShift, 0)); /* Calculate the chart horizontal and vertical center */ _chartHorCenter = _FCXShift+(_chartWidth/2); _chartVerCenter = _FCYShift+(_chartHeight/2); /* _global._embedFontFace defines the font face which has been embedded in this Flash movie for rotated text boxes. */ _global._embedFontFace = "Verdana"; /* We also define some local functions which will be used in this scene itself. */ function hideProgressBar() { //This function hides the progress bar //We first remove the border of the progress bar ASMovPBorder.removeMovieClip(); //Now, set the visibility of "fill" bar to false MovLoaderBg._visible = false; } /* xmlLoaded function acts as the onLoad event handler for _global.TxmlDataDoc XML Object. success is a Boolean value indicating whether the XML object was successfully loaded. If the XML document is received successfully, the success parameter is true. If the document was not received, or if an error occurred in receiving the response from the server, the success parameter is false. Based on this success parameter, we'll show the required msgs to the user */ function xmlLoaded(success) { if (success) { //Data has been loaded successfully - so check for validity of data if (_global.TxmlDataDoc.status == 0) { //Data is error free //So jump to FXMLDone Frame gotoAndPlay("FXMLDone"); } else { //XML Data is not well-formed. Show an error createText(1, "Invalid XML Data", _chartHorCenter, _chartVerCenter-(LPBarHeight/2), "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //Hide the progress bar hideProgressBar(); //Stop the control of the movie stop(); } } else { //An error occurred while fetching the data. Show an error to viewer createText(1, "Error in Loading Data", _chartHorCenter, _chartVerCenter-(LPBarHeight/2), "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //Hide the progress bar hideProgressBar(); //Stop the control of the movie stop(); } } €€ Functions/Constants˙˙˙˙O€˙˙€€˙˙˙˙O€˙˙€€/Create the text //If percentage numbers to be shown if (this.Params.showPercentageValues == 1) { dsVal = String(this.formatNumber(this.data[dataIndex].percentValue, false))+"%"; } else { dsVal = this.formatNumber(this.data[dataIndex].value); } var strText = ""; strText = this.data[dataIndex].hoverText+this.Params.hoverCapSepChar; strText = strText+dsVal; ASMovHoverCaptitangle 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) { /˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€˙˙˙?˙˙ FInitialize >€€ Labels˙˙˙˙O˙O˙€€€€˙˙˙?˙˙,˙,//-------------------------// //Chart Initialization here// //-------------------------// /* Set local width and height - this local width and height would be assumed if the user ha/This function unescapes a string, if the dataURL method is used var unStr = str; if (LboolIsURLProvided == true) { unStr = unescape(unStr); } return unStr; }; €€ Chart Class˙˙˙˙O€˙˙€€€€˙˙˙?˙˙Ś˙"//Include external relevant files //Utility Functions #include "../CodeBase/FCFunctions.as" //Utility Math routines #include "../CodeBase/FCMath.as" #include "../CodeBase/FCMath_ext.as" //Movie Clip #include "../CodeBase/FCMovieClip_Wedge.as" //Colors - default list #include "PieColors.as"€€ External Includes˙˙˙˙€€€˙€€˙˙ CPicSpriteCîü˙˙ Cîü˙˙˙˙˙˙ H€€˙˙˙?˙˙Ř€€ Embedded Text˙˙˙˙O˙˙˙€€€€˙˙˙?˙˙1˙6/* 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/FCFunctions.as - Utility Functions /CodeBase/FCMath.as - Utility Math Functions */€€ Description˙˙˙˙˙O˙˙€€ ments of the chart. External Includes in the scene: /CodeBase/FCFunctions.as - Utility Functions /CodeBase/FCMath.as - Utility Math Functions */€€ Description˙˙˙˙˙O˙˙€€ f the chart. E˙˙CPicPage˙˙ CPicLayer˙˙ CPicFrame€€˙˙˙?˙˙A€€€˙˙˙?˙˙JavaScriptHandlerM˙Ĺ//This frame responds to JavaScript data. //First, we check if new data has been actually supplied if (_root.isNewData == "1" && (_root.newData != undefined && _root.newData != null)) { //Means new data has been supplied //Get the new data _global.TxmlDataDoc = new XML(); _global.TxmlDataDoc.parseXML(_root.newData); //Now, clear the chart objects already rendered (with depth starting from this.Params.chartStartLevel to FCLastLevel) 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 //(typeof (obj) == "movieclip") && if ((obj.getDepth()<=_global._FCLastLevel) && (obj.getDepth()>=FCChart.Params.chartStartLevel)) { obj.removeMovieClip(); deleteText(obj.getDepth()); } delete obj; } //Re-set the global counter _global._FCLastLevel = FCChart.Params.chartStartLevel; //Delete FCChart delete FCChart; //If the data is not valid - show error msg and stop if (_global.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", "/Update progess bar FCPB.setValue(_global.TxmlDataDoc.getBytesLoaded()); } }; //Stop here. stop(); €€€˙˙˙?˙˙ý\˙ź//dataXML handler frame /* This frame handles the data provided via dataXML 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 parscenter", 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(); } €€€˙˙˙?˙˙ ErrorStopa//Just stop stop();€€ JavaScript Handler˙˙˙˙O˙O˙€€€€˙˙˙?˙˙V3˙/* 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 */ LNoDataText = getFirstValue(unescape(_root.ChartNoDataText), "No data to display."); //Next, we instantiate an object representing the chart class FCChart = new Chart(); //Acquire the data from the global XML ding data text var LPParsingDataText = getFirstValue(unescape(_root.ParsingDataText), "Reading Data. Please Wait"); //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(_root.dataXml); 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 dataXML method Here, we hide the progress bar, hide the loading text And finally, move the control to chart frame. */ if (LboolIsURLProvided) { //Delete _root's onEnterFrame event (defined in case of dataURL) delete _root.onEnterFrame; //Hide the progress bar (defined in case of dataURL) FCPB.erase(); } //Delete the text deleteText(2); //Move to the Chart scene gotoAndPlay("Chart", 1); €€ Actions˙˙˙˙O˙O˙€€€€˙˙˙?˙˙FdataLoadInitialize €€€˙˙˙?˙˙FdataURLHandleršu€€€˙˙˙?˙˙FdataXMLHandlerP#€€€˙˙˙?˙˙FDataLoadFinalizeî"€€ Labels˙˙˙˙˙OO˙€€€€˙˙˙?˙˙ŽV˙y/* 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. dataXML way - The whole XML data is present in the HTML Page (Containing FusionCharts) - sort of an XML ocument FCChart.acquireData(); //Parse the data into the Chart arrays and variables. FCChart.parseData(); //Now, if there is no data to display if (FCChart.Params.num == 0 || FCChart.Params.sumOfValues==0) { //Display the no data text createText(1, LNoDataText, _chartHorCenter, _chartVerCenter, "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //And stop stop(); } else { //Now, if we've data to display then carry on. //Calculate the co-ordinates of various elements on the chart FCChart.calculatePoints(); //Move to the next frame. play(); } €€€˙˙˙?˙˙StartĆ,˙E/* 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 sn't specified an exact size required for the chart - else it will be over-written. */ LChartWidth = 350; LChartHeight = 350; //Include Global Functions #include "../CodeBase/FCGlobalFunctions.as" //Include Initialization scripts #include "../CodeBase/FCInit.as" //---------------------------------------------------------------------// //----------------- CHART MOVIE PRELOADER BEGINS HERE -----------------// //---------------------------------------------------------------------// /* The pre loader has a lot of cosmetic properties that can be defined. We allow the user to take control of all those properties by specifying certain variables below. Variables that the user can specify in the chart container: PBarHeight - Required height for the progress bar. PBarWidth - Required width for the progress bar. PBarBorderColor - Border color of the progress bar PBarBorderThickness - Border thickness of the progress bar PBarBgColor - Progress bar background color (fill color of the bar) PBarTextColor - Color of the text PBarLoadingText - The actual loading text to be displayed Define local variables to store cosmetic properties */ var LPBarHeight, LPBarWidth, LPBarBorderColor, LPBarBorderThickness, LPBarBgColor, LPBarTextColor, LPBarLoadingText; //Set Progress bar Height LPBarHeight = Number(getFirstValue(_root.PBarHeight, "15")); /* Calculate the width of the progress bar :Explanation: How the width of the progress bar is being calculated? Basically, what we are aiming to do here is - Center align the progress bar elements with respect to the chart size. So, the width of the progress bar is set in such a way that is the chart width is greater than 200 pixels, the progress bar width will be 150 pixels. However, if the chart width is less than 200 pixels, then the progress bar width will be 25 pixels less than the chart width. */ LPBarWidth = (_chartWidth>200) ? 150 : (_chartWidth-25); //We also give the user an option to strong-enforce his own progress bar width value in case he wants something on his own. LPBarWidth = getFirstValue(_root.PBarWidth, LPBarWidth); LPBarBorderColor = getFirstValue(_root.PBarBorderColor, "E2E2E2"); LPBarBorderThickness = Number(getFirstValue(_root.PBarBorderThickness, "1")); LPBarBgColor = getFirstValue(_root.PBarBgColor, "E2E2E2"); LPBarTextColor = getFirstValue(_root.PBarTextColor, "666666"); LPBarLoadingText = getFirstValue(unescape(_root.PBarLoadingText), "Loading Chart. Please Wait"); //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. //We now draw the progress bar at the center of the stage. To do this, we create an instance of the FCProgessBar class attachMovie("FCProgressBar", "FCPB", 1); FCPB.setLimits(0, getBytesTotal()); FCPB.setPosition(_chartHorCenter-(LPBarWidth/2), _chartVerCenter); FCPB.setSize(LPBarWidth, LPBarHeight); FCPB.setColors(LPBarBgColor, LPBarBorderColor); FCPB.setBorderThickness(LPBarBorderThickness); FCPB.setValue(getBytesLoaded()); FCPB.draw(); //Create the loading text createText(2, LPBarLoadingText, _chartHorCenter, _chartVerCenter-(LPBarHeight/2), "Verdana", "10", LPBarTextColor, false, "center", "left", null, false); //Create the preloader sequence _root.onEnterFrame = function() { if (getBytesLoaded()IMovPie.\Rnds\Pie.flaMovPie@čĹA ÷=>I’`ĆA˙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.dataXML (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 preloade for this URL. External Includes in the scene: /CodeBase/FCDataLoad.as - Contains data loading functions. */€€ Description˙˙˙˙O€˙˙€€o get the actual height var LCanvasHeight = _chartHeight; var LCanvasWidth = _chartWidth; var LCanvasStartX, LCanvasEndX, LCanvasStartY, LCanvasEndY; var verticalBlockedHt = 0; var horizontalBlockWd = 0; //Deduct the top and bottom margins LCanvasHeight = LCanvasHeight-(this.Params.chartTopMargin+this.Params.chartBottomMargin); verticalBlockedHt = this.Params.chartTopMargin; //Now, if the caption is to be shown, deduct the height of the caption var LCaption; if (this.Params.showCaption == 1) {Chart" textbox deleteText(1); //Also, delete the size calculate movie clip deleteText(25001); //Render the background FCChart.drawBackground(); //Load Bacgkround swf FCChart.loadBgSWF(); //Set the labels on the chart FCChart.setLabels(); //Create the chart FCChart.renderChart(); //Render the *raw* hover caption FCChart.renderHoverCap(); //Now, if no animation is to be done, just stop if (FCChart.Params.animation==0) { stop(); } else { //Now do the animation part pieIndexVisible = 0; currentDataIndex = 1; play(); }€€€˙˙˙?˙˙MidŰk˙‘//Increase the index pieIndexVisible++; //Set the shadow and the slice visible mcPie = eval("Pie_Shadow_"+pieIndexVisible); mcPie._visible = true; mcPie = eval("Pie_"+pieIndexVisible); mcPie._visible = true; //Set name if (pieIndexVisible>FCChart.data[currentDataIndex].cumAngle) { //Set the name FCChart.setNames(currentDataIndex); //Increment currentDataIndex++; } //Delete object delete mcPie; €€€˙˙˙?˙˙FinalxŒ//If all the doughnut slices have not been drawn, draw if (pieIndexVisible<=360) { gotoAndPlay("Mid"); } else { //Finally stop stop(); } €€ Actions˙˙˙˙˙OO˙€€€€˙˙˙?˙˙ČO˙żj//** Chart Class **// //Chart is the base object on which the whole charting model will be based _global.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(); //Angles array this.angles = 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(); //** Set the data/properties of a few objects **/ //Params.num indicates the number of data sets passed to the graph this.Params.num = 0; //Sum of values this.Params.sumOfValues = 0; //Some constants to be used throughout the movie this.Constants.calcTextXPos = Number(getFirstValue(_root.calcTextXPos, "-200")); this.Constants.calcTextYPos ˙˙˙€Symbol 5 MovEmbedTextz}b@ ..\Draft.fla MovEmbedText$:őAz}b@$:őA˙˙˙˙€Symbol 6 FCProgressBarßwëA› FCProgressBar ..\Draft.fla FCProgressBarš ôAßwëA›š ôA˙˙˙˙XXhhhhh˙˙˙˙ŔŔŔ˙x´˙˙˙˙ü˙˙ CColorDef˙ €˙ €˙ €3˙Pď €f˙Pď0 €™˙PďH €Ě˙Pď` €˙˙Pďx €3˙ď €33˙(ď €3f˙<ď0 €3™˙CďH €3Ě˙Fď` €3˙˙Hďx €f˙ď0 €f3˙ď0 €ff˙(ď0 €f™˙5ďH €fĚ˙<ď` €f˙˙@ďx €˙ €333˙0 €˙ €3˙ ď €33˙xď €f3˙dď0 €™3˙]ďH €Ě3˙Zď` €˙3˙Xďx €33˙Čď €333˙0 €3f3˙PPH €3™3˙Px` €3Ě3˙Px €3˙3˙Pď €f3˙Üď0 €f33˙PH €ff3˙(PH €f™3˙<x` €fĚ3˙Cx €f˙3˙Fď €˙ €fff˙` €˙ €f˙ ď0 €3f˙Œď0 €ff˙xď0 €™f˙kďH €Ěf˙dď` €˙f˙`ďx €3f˙´ď0 €33f˙ PH €3ff˙xPH €3™f˙dx` €3Ěf˙]x €3˙f˙Zď €ff˙Čď0 €f3f˙ČPH €fff˙` €f™f˙P0x €fĚf˙Px €f˙f˙Pď¨ €˙ €™™™˙ €˙ €™˙ ďH €3™˙“ďH €f™˙…ďH €™™˙xďH €̙˙nď` €˙™˙hďx €3™˙­ďH €33™˙ x` €3f™˙Œx` €3™™˙xx` €3̙˙kx €3˙™˙dď €f™˙ťďH €f3™˙´x` €ff™˙ 0x €f™™˙x0x €f̙˙dx €f˙™˙]ď¨ €˙ €ĚĚĚ˙Ŕ €˙ €Ě˙ ď` €3Ě˙–ď` €fĚ˙Œď` €™Ě˙‚ď` €ĚĚ˙xď` €˙Ě˙pďx €3Ě˙Şď` €33Ě˙ x €3fĚ˙“x €3™Ě˙…x €3ĚĚ˙xx €3˙Ě˙nď €fĚ˙´ď` €f3Ě˙­x €ffĚ˙ x €f™Ě˙Œx €fĚĚ˙xx €f˙Ě˙kď¨ €˙ €˙˙˙˙đ €˙ €˙˙ ďx €3˙˙˜ďx €f˙˙ďx €™˙˙ˆďx €Ě˙˙€ďx €˙˙˙xďx €3˙˙¨ďx €33˙˙ ď €3f˙˙–ď €3™˙˙Œď €3Ě˙˙‚ď €3˙˙˙xď €f˙˙°ďx €f3˙˙Şď €ff˙˙ ď¨ €f™˙˙“ď¨ €fĚ˙˙…ď¨ €f˙˙˙xď¨ €˙ €˙˙ďx €˙ €™˙ďH €™3˙ ďH €™f˙ďH €™™˙(ďH €™Ě˙2ď` €™˙˙8ďx €Ě˙ď` €Ě3˙ ď` €Ěf˙ď` €̙˙ď` €ĚĚ˙(ď` €Ě˙˙0ďx €˙˙ďx €˙3˙ďx €˙f˙ďx €˙™˙ďx €˙Ě˙ ďx €˙˙˙(ďx €˙ €˙˙Pďx €˙ €™3˙ăďH €™33˙x` €™f3˙x` €™™3˙(x` €™Ě3˙5x €™˙3˙<ď €Ě3˙ćď` €Ě33˙x €Ěf3˙ x €̙3˙x €ĚĚ3˙(x €Ě˙3˙2ď €˙3˙čďx €˙33˙ď €˙f3˙ ď €˙™3˙ď €˙Ě3˙ď €˙˙3˙(ď €˙ €˙˙ ďx €˙ €™f˙ŐďH €™3f˙Üx` €™ff˙0x €™™f˙(0x €™Ěf˙<x €™˙f˙Cď¨ €Ěf˙Üď` €Ě3f˙ăx €Ěff˙x €̙f˙x €ĚĚf˙(x €Ě˙f˙5ď¨ €˙f˙ŕďx €˙3f˙ćď €˙ff˙ď¨ €˙™f˙ ď¨ €˙Ěf˙ď¨ €˙˙f˙(ď¨ €˙ €˙˙˙(ďx €˙ €™™˙ČďH €™3™˙Čx` €™f™˙Č0x €™™™˙ €™Ě™˙PP¨ €™˙™˙PďŔ €̙˙Ňď` €Ě3™˙Րx €Ěf™˙Üx €̙™˙P¨ €Ě̙˙(P¨ €Ě˙™˙<ďŔ €˙™˙Řďx €˙3™˙Üď €˙f™˙ăď¨ €˙™™˙ďŔ €˙̙˙ďŔ €˙˙™˙(ďŔ €˙ €˙˙˙xďx €˙ €™Ě˙žď` €™3Ě˙ťx €™fĚ˙´x €™™Ě˙ P¨ €™ĚĚ˙xP¨ €™˙Ě˙dďŔ €ĚĚ˙Čď` €Ě3Ě˙Ȑx €ĚfĚ˙Čx €̙Ě˙ČP¨ €ĚĚĚ˙Ŕ €Ě˙Ě˙PďŘ €˙Ě˙Đďx €˙3Ě˙Ňď €˙fĚ˙Őď¨ €˙™Ě˙ÜďŔ €˙ĚĚ˙ďŘ €˙˙Ě˙(ďŘ €˙ €˙˙˙Čďx €˙ €™˙˙¸ďx €™3˙˙´ď €™f˙˙­ď¨ €™™˙˙ ďŔ €™Ě˙˙ŒďŔ €™˙˙˙xďŔ €Ě˙˙Ŕďx €Ě3˙˙žď €Ěf˙˙ťď¨ €̙˙˙´ďŔ €ĚĚ˙˙ ďŘ €Ě˙˙˙xďŘ €˙˙˙Čďx €˙3˙˙Čď €˙f˙˙Čď¨ €˙™˙˙ČďŔ €˙Ě˙˙ČďŘ €˙˙˙˙đ €˙ €˙˙˙˙˙˙˙ €˙˙˙˙˙˙˙ €˙˙˙˙˙ €˙˙˙˙˙ €˙˙˙˙˙ €˙fý˙`˙˙˙˙z˙˙˙˙€™f˙Ş˙Ě˙˙˙˙˙˙ €˙˙˙*˙˙˙]˙˙˙˙˙Ş˙˙Ô˙˙˙˙˙˙%›Ţf˙˙he, "10")); this.Params.shadowColor = formatHexColor(getFirstValue(levelOneNodes[i].attributes.shadowColor, "B9B9B9")); //Text Gap between the pie end and the names this.Params.nameTBDistance = Number(getFirstValue(levelOneNodes[i].attr