Let's now try using a Model as datasource for a chart. |
|
Before you go further, we recommend you to go through the previous pages, as we start off from the concepts explained in those pages. |
Note that FusionCharts internally can accept only XML data (XML file or XML string). FusionCharts for Flex component makes this limitation more flexible for Flex developers. It adds another component or class named FCChartData to accept data from Array, XMLList or Model. It internally converts the data into XML and finally passes the XML to the chart. |
Like the previous examples we would create a Model object which would provide chart data and another Model object to provide chart parameters. |
<?xml version="1.0" encoding="utf-8"?> <!--Create the Model object as a data source for the chart parameters--> |
In the above code, we create a Model object, named chartData. We store chart data in it. We bind it to FCChartData. We also pass the chart parameters through FCParams attribute binding another model object chartParams to it. chartParams stores all the chart parameters. |
Please refer to "FusionCharts and XML » Chart XML Reference" section to know more on how to use parameters and elements from FusionCharts XML while providing data as XMLList. |
To know more about FCData and its attributes please go through the Class Structure Properties page under API Reference. |
The code would render the chart shown below : |
![]() |