Pie Chart changing data provider ?

Iv created a pie chart to which the dataprovider is often going to change , the problem is how can i draw the pie chart when the datprovider changes as currently the chart is drawn when the dataprovider hasnt been set and thereforee nothing is displayed?
Thanks Chris

<fx:Script>
        <![CDATA[
            import mx.rpc.events.ResultEvent;
            import mx.collections.XMLListCollection;          
            import mx.events.ListEvent;
            import mx.controls.Alert;
            [Bindable]
            public var stats_list:XMLList;
            [Bindable]
            public var stats_list_collection:XMLListCollection;
            //Handler for stats list xml.           
            public function stats_result(event:ResultEvent):void
                stats_list=event.result.stats
                stats_list_collection=new XMLListCollection(stats_list);                                                             
        ]]>
    </fx:Script>
<mx:PieChart id="piechart" dataProvider="{stats_list_collection}" showDataTips="true" color="#000000" name="Dynamic Pie Chart" right="0" left="0" top="40" bottom="10">
            <mx:series>
                <mx:PieSeries explodeRadius=".1" labelPosition="callout" displayName="Series 1" field="value" nameField="type" fills="{[sc1, sc2, sc3, sc4]}"/>
            </mx:series>
</mx:PieChart>
Chris,
I posted some information above that might be of some use to you.  Note that my PieChart dataProvider is: stats_list_collection 
When the function "stats_result" is triggered it changes the data for the PieChart and I reset the value of stats_list_collection.  When that happens it changes the PieChart to contain the new values from your XMLListCollection.  Basically the way this application was setup is to have a dropdown that a user selects and option from and it populates the data in the PieChart depending on their selection.
Another way of doing this (if you don't want to just update the dataProvider's content) is:
<fx:Script>
         <![CDATA[
              //pseudo code
          var dataprovider1:SOMETYPE = SOMETHING;
          var dataprovider2:SOMETYPE = SOMETHING;
          var dataprovider3:SOMETYPE = SOMETHING;
            public function WHATEVER YOU WANT THE TRIGGER TO BE(event:ResultEvent):void
                    switch(SOME CONDITION)
                         case "case 1":    piechart.dataProvider = dataprovider1;
                                                  break;
                         case "case 2":    piechart.dataProvider = dataprovider2;
                                                  break;
                         case "case 3":    piechart.dataProvider = dataprovider3;
                                                  break;
         ]]>
     </fx:Script>
<mx:PieChart  id="piechart">
            <mx:series>
                 <mx:PieSeries explodeRadius=".1" labelPosition="callout"  displayName="Series 1" field="value" nameField="type" fills="{[sc1, sc2,  sc3, sc4]}"/>
            </mx:series>
</mx:PieChart>
Hope this helps.  The secondary option I posted was mostly pseduo code but the idea should give you a starting point.

Similar Messages

  • Change Data Provider Based on ComboBox Selection

    Complete noob using Flash CS5 for Macs. I have a ComboBox component and a TileList. I want the ComboBox selection to change the data provider for the TileList. I've used a sample script from the Adobe website at the bottom, but it is not working in this context. Google returns no better examples. Can anyone point me in the right direction?
    import fl.controls.ComboBox;
    import fl.data.DataProvider;
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    import fl.events.DataChangeEvent;
    // Combo Box ("aCb")
    var aCb:ComboBox = aCb;
    var Choices:Array = new Array(
        {label:"Artist Resin", data: "resin"},
        {label:"Ceramic", data: "ceramic"}
    aCb.dataProvider = new DataProvider(Choices);
    // TileList ("aTl")
    aTl.columnWidth = 110;
    aTl.rowHeight = 130;
    aTl.setSize(110,150);
    aTl.move(20, 150);
    aTl.setStyle("contentPadding", 5);
    // TileList Content
    var i:uint = 0;
    var resinitems:Array = [
    {label: "Image 1", source: "http://www.helpexamples.com/images/montreal/images/IMG_5057.jpg"},
    {label: "Image 2", source: "http://www.helpexamples.com/flash/images/gallery2/images/IMG_1592.jpg"}];
    var resin:DataProvider = new DataProvider();
    for(i=0; i < resinitems.length; i++) {}
    var ceramicitems:Array = [
    {label: "Image 3", source: "http://www.helpexamples.com/flash/images/gallery1/images/pic11.jpg"},
    {label: "Image 4", source: "http://www.helpexamples.com/flash/images/gallery1/images/pic14.jpg"},];
    var ceramic:DataProvider = new DataProvider();
    for(i=0; i < ceramicitems.length; i++) {}
    addChild(aCb);
    addChild(aTl); 
    // Code to Change Data Provider for Tile List
    aCb.addEventListener(Event.CHANGE, changedataProvider);
    function changedataProvider(event:Event):void {
        aTl.dataProvider = event.target.selectedItem.data;

    Thanks for your answers.
    I have already checked those links.
    Now th problem what I am facing is,
    I am not able to call the function ChangeLanguage through javascript.
    I have created a dropdwon using Hovermenu and added English and German.
    Now when I click on these the function should be called.
    Please help me in getting how setClientSideScript() can be used to call a function.
    or any other way to call the function after clicking on Hovermenu Item.
    Thanks in advance,
    Sumangala

  • Hold variable values while changing data provider parameters in a template

    Dear experts,
    I have a problem in WAD. I have about 7 reports with 2 Queries each. Because of lower maintenance expenditure i would like to use only one web template. I created a dropdown item with a fixed option list. Every option represents one report and has two Set-Data-Provider Paramters commands which change the queries. It works fine but it can't hold the variables values. Example: every query contains the same variable (with suggestion value). If i insert a value into variable screen at the beginning and then use the dropdown-item to select another report, the next report is always calculated with the suggestion value of the variable (not with the typed in value at variable screen). How could i hand over this value to the next report/queries?
    If there is any solution whitout ABAP-programming i would prefer it.
    Kind regards
    Doris

    Dear experts,
    I have a problem in WAD. I have about 7 reports with 2 Queries each. Because of lower maintenance expenditure i would like to use only one web template. I created a dropdown item with a fixed option list. Every option represents one report and has two Set-Data-Provider Paramters commands which change the queries. It works fine but it can't hold the variables values. Example: every query contains the same variable (with suggestion value). If i insert a value into variable screen at the beginning and then use the dropdown-item to select another report, the next report is always calculated with the suggestion value of the variable (not with the typed in value at variable screen). How could i hand over this value to the next report/queries?
    If there is any solution whitout ABAP-programming i would prefer it.
    Kind regards
    Doris

  • Pie chart labels prepended with "@" symbol

    Hello
    I have a pie chart and it has two values, each of which is a formula
    When I view the Pie chart the Data labels and legend are prefixed with @
    The Data Value formula name is Open Online, so the data lable on the Pie is @Open Online, as it the legend
    It does not look great on the chart
    is there any way to use a forumla as a data value in a chart, but to NOT have the @ symbol as part of the name?
    This chart is developed in Crystal Reports 2008 SP2
    I am using a Pie Chart at the moment, the Pie has 1 On Change Of and 2 Data Values
    Best regards
    Patrick

    I believe if you select the label object on the design page and right-click, you will have the option to edit the label properties.
    Fuskie
    Who notes you can hard code a value but not alter any dynamic values...

  • Pie Chart with XML

    Hi,
    I want to display a normal / simple pie chart. Data will come from SAP NetWeaver Gateway Service. My problem is I created the view via XML and up to nw  I can not find any example to define a pie chart via XML. UI5 demo Apps already checked.
    Many thanks
    Best regards.
    Dominik

    Hi,
    thanks for the quick reply. But I not able to display the date from Net Weaver Gateway.
    <content>
         <ma:Chart id="visualisationPie" height="100%" width="100%" type="Pie" rows="{/visualizePOSet}" showRangeSelector="false"
         showTableView="false" showTotalValue="false" title='Test'>
    <ma:rows>
      <ma:Row>
    <ma:cells>
      <ma:Column name="Type" value="{type}" />
      <ma:Column name="Count" value="{count}" />
      </ma:cells>
      </ma:Row>
      </ma:rows>
      <ma:columns>
    <ma:Column name="Type" value="{type}" />
      <ma:Column name="Count" value="{count}" />
      </ma:columns>
      <ma:category>
      <ma:Category column="Type" displayName="Type of PO" />
      </ma:category>
      <ma:values>
      <ma:Value expression="Count" displayName="Count" />
      </ma:values>
      </ma:Chart>
    </content>
    That is the result.
    Here you can see an example form REST Client in Google chrome. That is the result when I call the GET methode.
    Regarding to the topic with viz Chart. I changed the libary because  I was not able to add title and the the prercent values for piece of the chart.
    Best regards
    Dominik

  • Query View name not saved in "Analysis Grid Properties" under Data Provider

    Hi BW World;)
    We are on BI 7.0
    I have created a BI workbook which contains a query view.
    However when we go into design mode and then "analysis grid properties" for this query view then "change data provider" it does not show the query view name but the query name. (we have saved the workbook)
    Is this the normal scenario?
    Surely should show the "query view name " and not the "query name" as confuses what data provider is being used?
    Is this a bug?
    Best
    Stevo.... Points of course... Thanks in advance.;)
    Edited by: bw4eva999 on Sep 10, 2009 4:40 PM     spelling

    Hi,
    You have created a workbook on top of a Query View which is again depends on a Query.Now the base for Query View is a Query.So the underlying Data Provider for a workbook is a Query.
    Hence when you go to Properties of grid->Change Data Provider,it shows the Query and the InfoCube,but not the Query View.
    So this is not a bug and this how its been designed.
    If you click for the Information of that workbook,it will show the Query and Info Provider,but not the query View.
    Though it looks like wierd,it is not a bug.
    Rgds,
    Murali

  • Pie Chart -- Text on Axis

    Help. I have created a pie chart. The chart has a title at the top and the legend appears to the right of the pie chart. However, my problem is there is "text" that is appearing at the bottom of the pie chart with the name of the data values column name. How can I get that text (subtitle) to disappear. Ex.
    O ---------> pie chart with data values showing and legend to the right (okay).
    xxxxx -------> text at the bottom of pie chart (do not want this text to appear). I'm not sure if this is
    considered "text" or a "label". I just need to turn it off. Help
    Thanks in advance!

    HI,
    While SAP solves the problem , you can do a quick fix by displaying only one either Char or % on pie chart and have a legend to display the other value(i.e normally charecterstic).
    Regards
    Madhukar

  • Drill down pie chart

    Hi,
    I have a pie chart that drills down to a column chart. I have assigned colours to the pie slices and dynamically assigned these to the column chart, to try and get the linkage between the two.
    However the pie chart changes the colour/shade of the selected pie slice, so that column chart is slightly different.
    Is it possible to have the select pie slice becoming detached from the chart to highlight that it has been selected and linked to the column chart?
    Thanks,
    Niall

    Thanks Senthil,
    I have the colours working between the two charts. But even in Ryan's example, when you click a slice it changes the colour of that slice, so that it doesn't match the colour of the column chart.
    What I am looking for, is to have the selected slice detach/offset from the pie chart to indicate more clearly that it is selected. When the user selects a different slice then that is detached and the original selection is reattached.
    I think Excel would refer to it an an exploded view of the pie chart. Is this possible?
    Thanks,
    Niall

  • Is ChartDoubleClick Event works in Pie Chart

    Hi Every one,
                      This is prasad.I have Pie chart with data and want to drill down on selecting the data in the pie chart.Is the chartdoubleclick event works in the Pie chart as of Bar chart works.Can any one help on this will be thankful.
    Thanks,
    Prasad.

    Can u give an example or  sample code for this legend trigger event.SInce this is the first time iam using this trigger event.
    Thanks,
    Prasad.

  • I have a problem with a chart refreshing after its bound data provider changes.

    I have a problem with a chart refreshing after its bound data
    provider changes. After the subsetHighLowData.refresh() is called I
    would expect the chart to redraw, but it still looks the same. I
    even inspected the debugger to see if the slice had taken place and
    it had.
    Any ideas coding friends?

    "nikos101" <[email protected]> wrote in
    message
    news:gib6aa$prr$[email protected]..
    >I have a problem with a chart refreshing after its bound
    data provider
    >changes.
    > After the subsetHighLowData.refresh() is called I would
    expect the chart
    > to
    > redraw, but it still looks the same. I even inspected
    the debugger to see
    > if
    > the slice had taken place and it had.
    >
    > Any ideas coding friends?
    >
    > subsetHighLowData.source =
    >
    highLowData.source.slice(slider.values[0],slider.values[1]);
    Just use the ArrayCollection's removeItemAt, and it should
    handle the event
    dispatching for you.
    HTH;
    Amy

  • When copying a Pie Chart from one Excel tab to a new Excel tab, the chart data is still referring to the original table

    Hi,
    In Excel 2007, I have a pie chart on sheet 1. I want to make a copy of the pie chart from sheet 1 and past into sheet 2, and change the table data in sheet 2 to get new chart recalculated based on new table values in sheet 2.
    However, the chart in sheet 2 is still pointing to the table data in sheet 1.
    All the cells in sheet 1 have relative cells.
    Please advise.
    Thanks - Bijan

    Hello Wind,
    As teylyn suggested:
    "An Excel chart is hard-wired to its data source. You can copy and paste a chart to a different sheet and it will still refer to the initial source data."
    So I did create the template and used in my 2nd tab which worked perfectly. However, I had an issue with merged cells which I am using for my data, and tylyn suggested that I provide the excel file that I am working with, and I did.
    So now I need help as how to make merged cells work when I try to create a pie chart from template based on new data (which reside in mergerd cells).
    P.S. I cannot resize my cells to make the data and labels fit into one call, so I have to have merged cells.
    Thanks
    Bijan

  • No data in Active sessions pie-chart and availability is 0%

    Hi All,
    Does anyone know why my Enterprise Manager cosole in Oracle 10g installed on windows xp professional is not showing any data? Availabilty is always 0% for the instance ORCL and the active sessions pie-chart is always showing 0.01 since May 17,2005.
    Can anyone tell me how to configure EM so that instance ORCL and the active sessions start showing data again?
    Thanks

    Hi,
    Kindly activate the data request. Post that, Under "request available for reporting" a symbol will appear which means that the data has been moved to Active table and is available for reporting at further levels.
    And you can then check for contents in the active table of the DSo, you should get the records.
    Change log: Contains the change history for the delta update from the DataStore object into other data targets, such as DataStore objects or InfoCubes. It makes sense in case of delta uploads.
    Regards,
    hemlata

  • Unable to change Data label position in the Chart using Position from Properties

    Hi All,
    I am trying add the Data label to the chart and the users want them to appear on the top of the stacked bars. By default when I enabled the data labels it showed up in the middle. When I tried to change the position by doing 
    View --> Properties --> Position --> Top/Bottom/any of other 8 options   -- it does move a bit
    I even tried deleting chart and recreating it.
    What am I missing? Thanks in advance.

    Hi Ranjith_SQL,
    According to your description that you have add the Data label on your stacked column chart  which by default display in the middle of the chart, you want them to appear on the top of the stacked column chart, right?
    For a Stacked Column Chart, the data labels are always placed in the center of the Series bars. This is by design. I also  test it on my new version of SSRS 2014  and find have the same result.
    If you really need the data label to display on the top, I recommend you to change the chart type to column chart which by default have the Data labels display at the top of the column: 
    You can also submit an wish at
    https://connect.microsoft.com/SQLServer/
    If the suggestion mentioned by customers for many times, the product team may consider to add the feature in the next SQL Server version. Your feedback is valuable for us to improve our products and increase the level of service provided.
    Thanks for your understanding.                        
    Regards
    Vicky Liu

  • Why can't I access the data when I right click my pie chart any longer?

    I don't know what happened but I need to change some data in my pie chart but I nolonger get the data option when right-clicking the chart...

    then I guess at some point it has been ungrouped, which makes it simply a collection of objects, rather than a graph. you're supposed to get this message when that happens. did you see this at any point? when did it stop being editable?

  • Interactive Bar/pie chart and line graph, data from excel/text file -urgent

    Hi,
    I have a huge data in excell sheet which keeps updating every month. Data basically consists of service provider and there respective subscribers from various regions of the country over the years. The requirement is to give the viewers an interactive page where in they can make various combinations and can compare, cross examine data according to thier choice.
    We want the pie chart / bar graph or line graph to be created on the fly according to the combination made by the user.
    The site is hosted on a red hat linux server. how can a connection to the excel spreadsheet be made or is it possible to read from the text file if the entire data is exported to a text file.
    Is there any ready made tool/code available which can be customised according to the need.
    Thanx in advance
    Regards
    Prakash

    I certainly wouldn't pay for the graphing package at the previous link. check out http://www.object-refinery.com/jfreechart/ for a free, open-source, much better looking graphing package.

Maybe you are looking for

  • Reading message from two queues and sort according the time stamp

    Hi I have a requirement where i have to read the message from two queue .. and sort according the Time stamp ( Field in payload ) and send it ot the Webservice .. How i acheive using the BPM.. in the BPM i have to collect the message for every 20 sec

  • How do I sync my photos and text messages from my last iphone (iphone 4) to new iphone?

    Just got the iphone 6. Can someone tell me how to sync my photos, old text messages, and notes from my last phone (iphone 4) to new phone? When I opened Itunes and connected my new phone...it said I can't sync my photos because I needed to update my

  • Getting error when calling package from master

    Hi , I am facing one issue , when i am running package indivisually its running fine , but when I am calling same package from Master package it gets failded. below is the error massage which I am getting. "Exception has been thrown by the target of

  • Diff. between JSP format & XML based syntax

    i like to know the diff. between 2 types of jsp syntax, JSP - 1 - ordinary <% code %> JSP - 2 - XML based syntax <jsp:expression> code </jsp:expression> what is best to use for jsp development.,

  • DCNM-install /reinstall on windows 8

    Well there's two problems I'm currently having. 1. Installing DCNM onto a windows 8 machine, I ran into a problem the 1st time I tried to install in that PostgreSQL doesn't like to be installed under program files in windows 8. It's a permission issu