FusionCharts for Flex > How it Works > XML Behind the Scenes

FusionCharts for Flex uses the FusionCharts charting components for converting your data into charts. These components use XML as a standard data interface. However, as a FusionCharts for Flex user you need not concern yourself with XML, since FusionCharts for Flex allows you to work with Flex data sources. This sections shows how Flex data sources are converted to XML in the back-end.

FusionCharts for Flex is an add-on component for the Flex SDK which allows you to create FusionCharts objects within the Flex environment. However, FusionCharts v3 charts are coded in ActionScript 2 (Flash 8) and runs on AVM1 while Flex uses ActionScript 3 (Flash 9+) and runs on AVM2. Never the twain shall meet. As such, if you're wondering how we've converted FusionCharts charts into Flex components, let us explain how we've achieved the same - we've not ported them to ActionScript 3. Instead, we have used FlashInterface for cross communication between AVM1 and AVM2.

The above diagram shows how data is processed and passed to the FusionCharts object. The FusionCharts SWC library acts as an interface between the FusionCharts objects and the Flex data sources.

Data is divided into two domains: String data in the form of FusionCharts XML and other generic data structures capable of expressing single / multi series data. String data may be declared in three ways: As external URL referring to FusionCharts XML, as external HTML file containing FusionCharts XML string or as Flex String in the form of FusionCharts XML. Other generic Flex data structures that can be used are ArrayCollection, XML and Model.

The FusionCharts SWC file passes on the string based data directly to the FlashInterface. However, for other Flex data sources, it converts them to FusionCharts XML first, and then passes them to the FlashInterface.