FusionCharts for Flex > Chart Creation > Multi-Series > Data from XML String

In this section we'll create a multi-series column 3D chart by providing data in form of XML String.

Before you continue, we recommend that you go through 'Your First Chart' section, as we start off from the concepts explained in that section.
 
For this chart we will use the XML which we created in the "Multi Series > Data from XML File" section. We will hard-code the XML in a string variable (see code below).
 

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:ns1="com.fusioncharts.components.*">

      <ns1:FusionCharts x="10" y="10" FCChartType="MSColumn3D" FCDataXML="{xmlData}" />

      <mx:Script>
        <![CDATA[

           // Create a string with valid chart data and xml tags
           [Bindable]
           private var xmlData:String="<chart caption='Business Results 2006 v 2007'" +
               "xAxisName='Month' yAxisName='Revenue' showValues='0' numberPrefix='$'>" +
                  "<categories>" +
                  "   <category label='Jan' />" +
                  "   <category label='Feb'/>" +
                  "   <category label ='Mar'/>" +
                  "   <category label='Apr'/>" +
                  "   <category label='May' />" +
                  "   <category label='Jun'/>" +
                  "</categories>" +
                  "<dataset seriesName='2007'>" +
                  "   <set value='27400'/>" +
                  "   <set value='29800'/>" +
                  "   <set value='25800'/>" +
                  "   <set value='26800'/>" +
                  "   <set value='29600'/>" +
                  "   <set value='32600'/>" +
                  "</dataset>" +
                  "<dataset seriesName='2006'>" +
                  "   <set value='10000'/>" +
                  "   <set value='11500'/>" +
                  "   <set value='12500'/>" +
                  "   <set value='15000'/>" +
                  "   <set value='11000'/>" +
                  "   <set value='9800'/>" +
                  "</dataset>" +
             "</chart>";

        ]]>
      </mx:Script>
</mx:Application>

 
In the code, we passed data through a XML String object named xmlData. For this, we have created the string with valid chart data. Now, if you run the code, you'll get the following chart: