Using xml as dataProvider for chart

I am trying to use a loaded xml as the dataProvider for a pie chart like this
<mx:PieChart id="pieChart"
                     dataProvider="{get_xml.lastResult.AssetAllocationFunds.fund[0].target_allocation}">
This works, but gives a warning that
"Data binding will not be able to detect changes when using the square bracket operator. For Array, please use ArrayCollection.getItemAt() instead."
Can someone give me some direction on how to implement this.
Thanks.

So that solution I posted up wasn't going to work for what I needed.
Basically, the "itemRollOver" and "itemClick" that work for the pie chart when hard coded on the main application don't work when embedded in a custom class that extends the PieChart. I haven't been able to figure out why.
However, I did get the syntax for targeting ArrayCollection.getItemAt() worked out.
Here is a simple example.
Hope it helps others.
Mark
<?xml version="1.0" encoding="utf-8"?>
<s:Application
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark"
    >
    <fx:Script>
        <![CDATA[
            import mx.charts.events.ChartEvent;
            import mx.charts.events.ChartItemEvent;
            import mx.charts.series.items.PieSeriesItem;
            import mx.collections.ArrayCollection;
            import mx.events.FlexEvent;
            import mx.rpc.events.ResultEvent;
            import mx.charts.series.PieSeries;
            private function pieChart_itemRoll(evt:ChartItemEvent):void {
                var psi:PieSeriesItem = evt.hitData.chartItem as PieSeriesItem;
                myTextArea.text += "\rtarget: "+psi.item.target;
                trace(psi.item.target);
            private function pieChartClick(event:ChartItemEvent, pieName:String):void{   
                myTextArea.text += "\rid: "+pieName;
            [Bindable]
            private var chartData:ArrayCollection = new ArrayCollection(
                [[{target:"Target A0",percent:40},
                    {target:"Target A1",percent:30},
                    {target:"Target A2",percent:20},
                    {target:"Target A3",percent:10}],
                    [{target:"Target B0",percent:45},
                        {target:"Target B1",percent:22},
                        {target:"Target B2",percent:17},
                        {target:"Target B3",percent:8}]]);
        ]]>
    </fx:Script>
    <s:VGroup>
        <s:HGroup id="myGroup">
            <mx:PieChart
                dataProvider="{chartData.getItemAt(0)}"
                itemRollOver="pieChart_itemRoll(event);"
                itemClick="pieChartClick(event, 'pie 0');"
                showDataTips="false"
                height="210"
                width="210">
                <mx:series>
                    <mx:PieSeries
                        field="percent"
                        nameField="target"
                        labelPosition="inside"
                        >
                    </mx:PieSeries>
                </mx:series>
            </mx:PieChart>
            <mx:PieChart
                dataProvider="{chartData.getItemAt(1)}"
                itemRollOver="pieChart_itemRoll(event);"
                itemClick="pieChartClick(event, 'pie 1');"
                showDataTips="false"
                height="210"
                width="210">
                <mx:series>
                    <mx:PieSeries
                        field="percent"
                        nameField="target"
                        labelPosition="inside"
                        >
                    </mx:PieSeries>
                </mx:series>
            </mx:PieChart>
        </s:HGroup>
        <s:TextArea id="myTextArea"  width="550" height="220" />
    </s:VGroup>
</s:Application>

Similar Messages

  • XML as dataProvider for Charts

         I want to display XML exported from Oracle Database as a chart......
    The xml has the following structure :
    <ROWSET>
          <ROW>
                <ORDER_ITEMS_ID>1</ORDER_ITEMS_ID>
                <ORDER_ID>1</ORDER_ID>
                <PRODUCT_ID>1</PRODUCT_ID>
                <UNIT_PRICE>1200</UNIT_PRICE>
                <QUANTITY>1</QUANTITY>
          </ROW>
          <ROW>
                <ORDER_ITEMS_ID>2</ORDER_ITEMS_ID>
                <ORDER_ID>7</ORDER_ID>
                <PRODUCT_ID>1</PRODUCT_ID>
                <UNIT_PRICE>1100</UNIT_PRICE>
                <QUANTITY>3</QUANTITY>
          </ROW>
    </ROWSET>
    I've seen many chart examples using ArrayCollection as DataProvider . using the same way , i tried to set xml . But no results.
    Can you please suggest me how to set an XML as dataprovider ? ( or XMLList or XMLlistcollection )
    ( i'm developing a small app in AIR )

    Sample app from Adobe's livedocs:
    XML:
    <data>
        <result month="Jan-04">
            <apple>81768</apple>
            <orange>60310</orange>
            <banana>43357</banana>
        </result>
        <result month="Feb-04">
            <apple>81156</apple>
            <orange>58883</orange>
            <banana>49280</banana>
        </result>
    </data>
    Application:
    <?xml version="1.0"?>
    <!-- charts/XMLFileDataProvider.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Model id="results" source="../assets/data.xml"/>
      <mx:Panel title="Line Chart">
         <mx:LineChart id="myChart" dataProvider="{results.result}" showDataTips="true">
            <mx:horizontalAxis>
               <mx:CategoryAxis categoryField="month"/>
            </mx:horizontalAxis>
            <mx:series>
               <mx:LineSeries yField="banana" displayName="Banana"/>
               <mx:LineSeries yField="apple" displayName="Apple"/>
               <mx:LineSeries yField="orange" displayName="Orange"/>
            </mx:series>
         </mx:LineChart>
         <mx:Legend dataProvider="{myChart}"/>    
      </mx:Panel>
    </mx:Application>
    Tanu

  • How to use XML Anonymizer Module for receiver mail Adapter?

    Hi All,
             I would like to know how to use XML Anonymizer Module for receiver mail adapter so as to change the namespace to http://sap.com/xi/XI/Mail/30 from my original namespace? Thank you all in advance?

    Hi,
    This may help u:
    Replacing one namespace with another using XML Anonymizer Module
    Thanks
    Amit

  • When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?

    When we use XML,XSD,WSDL files to create SOA webservices in jdeveloper ,what will happen means internally,how will useful xml ,xsd,wsdl for composite ?
    How xml will send message to XSD then how wsdl interaction then to composite ?

    XSD (XML Schema Definition), is an abstract representation of a XML characteristics.
    The WSDL (Web Services Description Language), describes the functionality offered by your web service.
    You can say what operations your services offers, and describe the messages used for this operations in your XSD.

  • How to use getCustomizing and setCustoming for charts?

    Hi. Experts!
    Can you give examples for using setCustomizing method for charts?
    And i'm have problem with multi-byte language in the chart caption.
    It's shown normally in the desinger, but not after deploying.
    If i'm open component source (chart node) (don't remember file extension)
    i'm see what problem occured here
    <?xml ..... utf-8>
    <! CDATA .........<?xml ......utf-8>
    <chart......>
    <Elements>
    <Title>
    <Caption>Chart Caption here</Caption
    </Title>
    P.S. NWDS 7.0.15

    Up...

  • Can we use xml Publisher reporting for sql* Plus in EBS

    Hello All,
    The current report is designed in Sql* Plus Executable report and the output is in txt format, Now the requirement is to have the output in Excel format.
    So is it possible to use the xml reporting and make the output as Excel from the word template we design from MSword as we do for rdf(I have done few reports created in rdf to xml publisher reports in EBS and stand alone as well.).
    Do the same procedure will suit for Sql*Plus reports tooo or Is there any work around to achieve this.
    Thanks and Regards
    Balaji.

    Hi
    Thanks for the reply..
    I tried to do the follwoing
    1. changed the output to xml in the conc. prog.
    2. ran the same report but i am getting the follwoing error in the output file
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    Invalid at the top level of the document. Error processing resource
    Other reports which are using the Oracle Reports(rdf) as source, i am able to generated the xml as expected....
    So my question is whether we can use sql* reports executable and generate xml in the conc.prog.
    if any one has used the sql*reports for xml publisher reporting... please let me know, so that if its possible i will check my sql needs some validation or tuning...
    thanks in advance
    Balaji.

  • Using an hierarchical dataProvider for a TileList

    Hey guys,
    I am working on a Flex3 project and do have a viewStack holding two components: an AdvancedDataGrid and a TileList
    Both of these are supposed to be based on the same dataprovider and due to the nature of the viewstack easily switchable.
    The AdvancedDataGrid is already implemented and uses HierarchicalData as dataProvider (I only have two levels, where the second level is given by an attribute with the type ArrayCollection in the first level).
    Now I have to tell my TileList somehow to transform this hierarchical data into plain data by simply flatting it (i.e. Level1, Level1.1, Level1.2, Level 1.3, ..., Level 2, Level 2.1, ...Level3 , ...).
    I already thought about using an ICollectionView interface and to use some form of other adapter. But I could not really manage to get something working....so any hints/ideas?
    cheers a lot and happy new year!!

    nobody got a hint?

  • Using XML as header for Image

    Has anyone used an XML document to describe an image? I have the image already in iFS and then I want to pass in an XML document that describes the image. What path should I take to link the two together, or make them both seen as one object?
    Jason Adkison
    New Mexico Mutual Casualty

    You can use an XML file to supply the attribute values for a Document, or a content type based on the Document class.
    1) First, ensure that the elements in the XML file map to correspondingly named attributes on the content type.
    2) Include in the XML file an <UPDATE RefType="Path"> tag which specifies the full path of the file in the repository.
    3) Import the XML file into the repository with parsing enabled (automatically enabled with SMB)
    Example:
    <?xml version = '1.0' standalone = 'yes'?>
    <DOCUMENT>
    <UPDATE RefType="Path">/home/guest/doc2.txt</UPDATE>
    <NAME>doc2_new.txt</NAME>
    </DOCUMENT>
    Please review the Oracle iFS Application Developer's Guide, Chapter 4 - creating custom classes for a description of how to create custom content types to track extra attributes pertinent to your images.

  • HTTP 500 Error while using XML HTTP Port for idoc

    Hi,
    I am trying to send CRM idocs via XML Http instead of usual t-rfc.
    After standard idoc - pi configs i get the below error.
    transferring the IDoc by HTTP, the return code with the message '500Error during parsing of SOAP header' has occurred.
    In BD87 I get the below error.
    The target address was: http://yyyyyy.XXX.local:800X/sap/xi/engine?type=entry
    I get the http 500 error as:-
    Check whether the IDoc can be sent again.
    It is unfortunately not possible to determine automatically whether the IDoc has in fact arrived in the target system and the error occurred afterwards
    Any idea on how to trouble shoot or resolve this.
    Regards,
    Anirban

    Hi Anirban,
      Follow the below links for troubleshooting.
    Troubleshooting  File-to-IDOC Scenario in XI.
    The specified item was not found.
    Regards,
    Leela

  • Problem for using oracle xml parser v2 for 8.1.7

    My first posting was messed up. This is re-posting the same question.
    Problem for using oracle xml parser v2 for 8.1.7
    I have a sylesheet with
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">.
    It works fine if I refer this xsl file in xml file as follows:
    <?xml-stylesheet type="text/xsl" href="http://...../GN.xsl"?>.
    When I use this xsl in pl/sql package, I got
    ORA-20100: Error occurred while processing: XSL-1009: Attribute 'xsl:version' not found in 'xsl:stylesheet'.
    After I changed name space definition to
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> in xsl file, I got
    ORA-20100: Error occurred while processing: XSL-1019: Expected ']' instead of '$'.
    I am using xml parser v2 for 8.1.7
    Can anyone explain why it happens? What is the solution?
    Yi

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Steven Muench ([email protected]):
    Element's dont have text content, they [b]contain text node children.
    So instead of trying to setNodeValue() on the element, construct a Text node and use the appendChild method on the element to append the text node as a child of the element.<HR></BLOCKQUOTE>
    Steve,
    We are also creating an XML DOM from java and are having trouble getting the tags created as we want. When we use XMLText it creates the tag as <tagName/>value rather than <tagName>value</tagName>. We want separate open and close tags. Any ideas?
    Lori

  • How to filter cancelled PO lines using XML publisher desktop

    Hello,
    I've created a new PO template for printing using XML Publisher Desktop for Word. Output format is in RTF. All data required was printed except when the user canceled a particular PO line, that line will also be printed out with quantity and total amount 0. How can I filter PO lines with "canceled" flag not be printed out? Is it possible to insert conditional statement within the table template? How to do that?
    Thanks in advance

    if you want only test it by XML publisher desktop
    then you can use if statement
    for example in field
    <?if:TAG1='test?>then
    <?TAG2?>then
    <?end if?>for row between (for example)
    <?for-each:G_GROUPNAME?>and
    <?end for-each?>BTW use this method is not correct in my opinion
    if you use "canceled" flag as parameter in concurrent program
    then you may get xml for RTF template only with needed data

  • How to create multiple ifs users using XML

    I used the following xml file to create a ifs user. But I don't know how to create multiple users using XML. Thanks for your help.
    <SimpleUser>
    <UserName>bill</UserName>
    <Password>bill</Password>
    <DirectoryUserDescription>Bill</DirectoryUserDescription>
    </SimpleUser>

    There are many good resources for Powershell tutorials. The MS help page for each cmdlet is usually a good place to start.
    The suggested answer is very good and easy to modify to your needs. The linked article provides good detail on creating your csv file. If you look at their sample csv, you will see the column for LicenseAgreement and UsageLocation. You can change the script
    to use the values from the csv instead of the same value for every user like so:
    -LicenseAssignment $_.LicenseAgreement -UsageLocation $_UsageLocation
    Basically, $_.<valuename> is the filled in by the value under the heading <valuename> in your csv file for the current user. 
    As for what msdivision, replace this with the correct domain name value for your organization. You can get the values for license SKUs from existing users by using the following:
    Connect-MsolService
    Get-MsolUser -UserPrincipalName <userprincipalname> |select Licenses

  • Possible to use Ms Excel data as a dataprovider in Flashbuilder for charting

    My dept has an excel spreadsheet with sales data. I'd like to know if anyone has used Excel data for charting in Flashbuilder? Does anyone know of any resources or samples?
    Thanks in advance.

    Looks like I found my own answer. 
    Seems that all I need to do was convert my Header data into a 2D array. 
    Don't know why that one was so tricky to figure out.  But it's working now.   
    Patrick Allen

  • How to pass apex item value into custom xml for chart or guage?

    Re-opening the old thread : Re: How to pass apex item value into custom xml for chart or guage?
    Which was not answered.
    Roel - Thanks. Its working - but in a semi quotes in the custom XML
    <pointers>
    <pointer value= '&P5_RUNNING_TOTAL.'
    <label enabled="true">
    <position placement_mode="ByPoint" x="50" y="15" />
    <format>{%Value}{numDecimals:1}</format>
    <background enabled="false" />
    </label>
    </pointer>
    </pointers>This question was helpful for us to resolving one recent thread : AnyChart - set Dial axis intervals dynamically?
    (Re: AnyChart - set Dial axis intervals dynamically?
    Edited by: P.Ranish on Dec 13, 2012 6:23 AM

    P.Ranish wrote:
    Is there any update for this question ???
    Edited by: P.Ranish on Dec 13, 2012 3:36 AMNo, And there won't be in the future.
    Please stop posting followup's to old threads, if you have a real problem please search the forum first and post a new question with all information
    Roel wrote:
    Try using &P5_RUNNING_TOTAL. or #P5_RUNNING_TOTAL#Just to make it clear - this will only work if page is reloaded after setting the item values dynamically via AJAX

  • Little help with complex XML data as data provider for chart and adg

    Hi all,
    I've been trying to think through a problem and Im hoping for
    a little help. Here's the scenario:
    I have complex nested XML data that is wrapped by subsequent
    groupings for efficiency, but I need to determine if each inner
    item belongs in the data collection for view in a data grid and
    charts.
    I've posted an example at the bottom.
    So the goal here is to first be able to select a single
    inspector and then chart out their reports. I can get the data to
    filter from the XMLListCollection using a filter on the first layer
    (ie the name of the inspector) but then can't get a filter to go
    deeper into the structure in order to determine if the individual
    item should be contained inside the collection. In other words, I
    want to filter by inspector, then time and then tag name in order
    to be able to use this data as the basis for individual series
    inside my advanced data grid and column chart.
    I've made it work with creating a new collection and then
    looping through each time there is a change to the original
    collection and updating the new collection, but that just feels so
    bloated and inefficient. The user is going to have some buttons to
    allow them to change their view. I'm wondering if there is a
    cleaner way to approach this? I even tried chaining filter
    functions together, but that didn't work cause the collection is
    reset whenever the .refresh() is called.
    If anyone has experience in efficiently dealing with complex
    XML for charting purposes and tabular display purposes, I would
    greatly appreciate your assistance. I know I can get this to work
    with a bunch of overhead, but I'm seeking something elegant.
    Thank you.

    Hi,
    Please use the code similar to below:
    SELECT * FROM DO_NOT_LOAD INTO TABLE IT_DO_NOT_LOAD.
    SORT IT_DO_NOT_LOAD by WBS_Key.
        IF SOURCE_PACKAGE IS NOT INITIAL.
          IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[].
    LOOP AT IT_SOURCE_PACKAGE INTO WA_SOURCE_PACKAGE.
            V_SYTABIX = SY-TABIX.
            READ TABLE IT_DO_NOT_LOAD into WA_DO_NOT_LOAD
            WITH KEY WBS_Key = WA_SOURCE_PACKAGE-WBS_Key
            BINARY SEARCH.
            IF SY-SUBRC = 0.
              IF ( WA_DO_NOT_LOAD-WBS_EXT = 'A' or WA_DO_NOT_LOAD-WBS_EXT = 'B' )     
              DELETE IT_SOURCE_PACKAGE INDEX V_SYTABIX.
            ENDIF.
    ENDIF.
          ENDLOOP.
          SOURCE_PACKAGE[] = IT_SOURCE_PACKAGE[].
        ENDIF.
    -Vikram

Maybe you are looking for

  • How to create a transport for queries from production system

    We have a situation where the production client has been open during cutover and a user has modified queries which were previously transported into production from our development system. We now wish to 'synchronise' our systems so production can be

  • How to dial telephone numbers which have letters instead of digits?

    I'm new to Blackberry products & just bought a 8330 curve.  Unlike my other smartphones which had the option of a dial key pad, the Curve appears to have forgotten to include one.  When a telephone number is spelled out with letters instead of digits

  • Document for configuring Early watch alerts And issue tracking system

    Hello Experts, Iam on SAP Solution Manager 4.0 and need step wise step procedure document for configuring Early watch alerts and Issue tracking system in solman 4.0 . I hv checked Help site and other standard config docs by SAP but getting confused a

  • How to draw an arc in the image window?

    Now I try to draw an arc in the image window, but when I try to use IMAQ Overlay Arc.vi, it need Bounding Rectangle that made a problem because the arc I draw has a big size whose bounding rectangle was out of the image window. What should I do?

  • Canon PIXMA MX880

    Hi Everyone, My printer is connected to a Dell desktop.  The Windows version I'm using is 6.1.7601.  This has been set up for at least 3 years now & has been working fine. Today when I try to scan a document using the Canon MP Navigator it tells me "