FusionCharts for Flex > API Reference > Properties

FusionCharts for Flex component is made up of a class, named FusionWidgets that lets you create and render gauges and charts (from FusionWidgets pack) within your Flex project. We access the same class as a visual component in Design mode.
 
<components:FusionWidgets x="10" y="10" FCDataURL="Data.xml" FCChartType="AngularGauge" />
 
This object has four properties. These are listed below in a tabular form.
Property Name Description
FCChartType This property lets you set the type of the widget (gauge/chart). The list of all available widgets types is given in "List of Widgets" page in Introduction section.
FCDataURL This property helps you to provide the path of your external XML file needed to build the widget.
FCDataXML It enables you to pass the entire widget XML as string.
FCDebugMode This attribute lets you open a debug window on top of widget. It takes either of the two value - true or false. If it is set to true, the debug window will open up. The default value is false.
FCFolder This attribute sets the folder where the widget SWF files are kept. By default, FusionCharts for Flex component assumes that the widgets are present in fusionwidgets folder in src folder or the folder where the application MXML files is present. But, the developer can always decide to keep the widget SWF files in a different folder. The value of this attribute would be a path relative to the Application MXML file's folder.
Example: "." - when the widget SWF files resides in the same folder as the Application MXML file.
myWidgets - when widgets SEF files will be in a folder named myWidgets inside the Application MXML file's folder.
resources\widgets - widgets are in widgets folder inside resources folder. The resources folder is placed in folder where Application MXML file is present.
 
Create Widget (gauge/chart) using script
You can create a widget using only script. Below is a simple example:
 

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
   xmlns:s="library://ns.adobe.com/flex/spark"
   xmlns:mx="library://ns.adobe.com/flex/mx"
   initialize="showChart()">


   <fx:Script>
      <![CDATA[

         //import FusionCharts for Flex class
         import com.fusionwidgets.components.FusionWidgets;

         //execute the function when the application initializes
         private function showChart():void
         {
            //instantiate a FusionCharts for Flex object
            var FW:FusionWidgets = new FusionWidgets();                    

            //Set widget type

            FW.FCChartType="AngularGauge";
            //set widget data source XML
            FW.FCDataURL="Data.xml";

            // x, y position on stage
            FW.x=10;
            FW.y=10;
            FW.width=400;
            FW.height=300;

            //show the component in the stage

            addElement(FW);           
         }

      ]]>

   </fx:Script>

</s:Application>

 
FCChartData Class
 
The following are the properties of the FCChartData class.
Property Name Description
ChartNoDataText If the widget fails to get renedered due to the absence of any XML data, an error message will be thrown. This attribute allows you to create user defined error message within your Flex project.
InvalidXMLText This attribute lets you customize the error message generated due to invalid XML data.
LoadDataErrorText It lets you customize the error message generated due to any error in loading the data.
ParsingDataText This attribute lets you customize the error message generated due to any error in parsing the data.
PBarLoadingText It lets you customize the waiting message that tells the user to wait untill the widget gets loaded completely.
RenderingChartText This attribute lets you customize the waiting message that tells the user to wait until the widget gets rendered completely.
XMLLoadingText It lets you customize the waiting message that informs the user to wait until the XML gets retrieved completely.