FusionCharts for Flex also allows developers to use existing Flex data sources: Array, XMLList, and Model. to provides data to the chart. In this section we will explain how to provide data to the chart using Array. |
Note: FusionCharts internally can accept only XML data (XML file or XML string). FusionCharts for Flex component helps developers by making things more flexible. It offers another component or class named FCChartData that accept data from Array, XMLList, or Model and converts the data into XML. |
Before you continue, we recommend you to go through the previous sections, as we start off from the concepts explained in those sections. |
We have again used the first example and modified it to show how chart data can be provided using ArrayCollection. The code for this is given below: |
<?xml version="1.0" encoding="utf-8"?> //Create an ArrayCollection object as a data source for chart |
As you can see in the highlighted section of the code:
|
Please refer to "FusionCharts and XML » Chart XML Reference" section to learn more about chart parameters and elements that can be used while providing data as Array. |
To know more about FCData and its attributes please go through FusionCharts Properties page under Chart API Reference section. |
Now, if you run the above code in your Flex project, the following chart will be rendered: |
![]() |