How to retrieve pie chart wedge id

Hi.
I'm trying to figure out how to get an id or index of a specific wedge from a pie chart
I think I'm close. I just need to find the right path to the wedge id.
This is what I have so far.
<fx:Script><![CDATA[
        import mx.charts.events.ChartItemEvent;
        private function itemClickHandler(e:ChartItemEvent):void {
            var selectedIndx:String= e.currentTarget.series.index; //<--returns null
    ]]></fx:Script>
<s:VGroup>
        <mx:PieChart width="220" height="220" id="piechart1"
                     dataProvider="{srv.lastResult.AAFunds.fundName}"
                     itemClick="itemClickHandler(event)"
                     >
            <mx:series>
                <mx:PieSeries  displayName="pie series 1" />
            </mx:series>
        </mx:PieChart>
    </s:VGroup>

Figured it out.
Here is a simple example;
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/11/15/displaying-a-pieseries-items-data-when-a-user-clic ks-an-item-in-a-flex-piechart-control/ -->
<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:Declarations>
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import mx.charts.series.items.PieSeriesItem;
            import mx.charts.events.ChartItemEvent;
            [Bindable]
            public var chartDP:Array = [
                {wedgeName:'Pie wedge 1', percent:45 },
                {wedgeName:'Pie wedge 2', percent:25},
                {wedgeName:'Pie wedge 5', percent:22},
                {wedgeName:'Pie wedge 4', percent:8}
            private function pieChart_itemClick(evt:ChartItemEvent):void {
                var psi:PieSeriesItem = evt.hitData.chartItem as PieSeriesItem;
                myTextArea.text += "\rwedgeName: "+psi.item.wedgeName+" percent: "+ psi.item.percent;
        ]]>
    </fx:Script>
<s:VGroup>
    <mx:PieChart id="pieChart"
                 dataProvider="{chartDP}"
                 itemClick="pieChart_itemClick(event);"
                 showDataTips="false"
                 height="300"
                 width="300">
        <mx:series>
            <mx:PieSeries id="pieSeries"
                          field="percent">
            </mx:PieSeries>
        </mx:series>
    </mx:PieChart>
    <s:TextArea id="myTextArea"  y="82" width="350" height="250" />
</s:VGroup>
</s:Application>

Similar Messages

  • Animate Pie Chart Wedge SEPARATION

    Is it possible to start with the entire pie chart, and then animate a wedge separating from the chart?
    PS - I know how to animate each individual pie chart wedges from appearing on a slide, that is not what I am trying to do.

    OK, now I get it. So you would need to place your two PieCharts in a s:Group or mx:Canvas. On top of the pie charts, lay another s:Group on which you will do some drawing on its graphics:Graphics object.
    In your case, you need to use dataToLocal() (will give you pixel coordinates in your chart) then localToGlobal()  (convert to Application coordinates) then globalToLocal() (convert to the Top Group or Canvas coordinates you want to draw in) :
    Using the dataToLocal() method
    The dataToLocal() method converts a set of values to x  and y coordinates on the screen. The values you give the method are in  the "data space" of the chart; this method converts these values to  coordinates. The data space is the collection of all possible combinations of data values that a chart can represent.
    The number and meaning of arguments passed to the dataToLocal() method depend on the chart type. For CartesianChart controls, such as the BarChart and ColumnChart controls, the first value is used to map along the x axis, and the second value is used to map along the y axis.
    For PolarChart controls, such as the PieChart control, the first value maps to the angle around the center of the  chart, and the second value maps to the distance from the center of the  chart along the radius.
    The coordinates returned are based on 0,0  being the upper-left corner of the chart. For a ColumnChart control, for  example, the height of the column is inversely related to the x  coordinate that is returned.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#localToGlobal%28%29
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#globalToLocal%28%29

  • Pie chart wedge itemRollOver

    I need help with creating a custom pie chart class that will allow a function call on pie wedge rollOver.
    Right now I can get a function call on rollover using itemRollOver using;
    import mx.charts.events.ChartItemEvent;
    -in the <mx:PieChart>;
    itemRollOver="pieChart_itemRoll(event);"
    -which calls this function
    private function pieChart_itemRoll(evt:ChartItemEvent):void {
                    var psi:PieSeriesItem = evt.hitData.chartItem as PieSeriesItem;
                    trace(psi.item.target);
    Please advise on how can I put this into a custom PieChart .as that extends PieChart?
    Currently itemRollOver in my custom class throws an undefined property error.
    Thanks.

    OK, now I get it. So you would need to place your two PieCharts in a s:Group or mx:Canvas. On top of the pie charts, lay another s:Group on which you will do some drawing on its graphics:Graphics object.
    In your case, you need to use dataToLocal() (will give you pixel coordinates in your chart) then localToGlobal()  (convert to Application coordinates) then globalToLocal() (convert to the Top Group or Canvas coordinates you want to draw in) :
    Using the dataToLocal() method
    The dataToLocal() method converts a set of values to x  and y coordinates on the screen. The values you give the method are in  the "data space" of the chart; this method converts these values to  coordinates. The data space is the collection of all possible combinations of data values that a chart can represent.
    The number and meaning of arguments passed to the dataToLocal() method depend on the chart type. For CartesianChart controls, such as the BarChart and ColumnChart controls, the first value is used to map along the x axis, and the second value is used to map along the y axis.
    For PolarChart controls, such as the PieChart control, the first value maps to the angle around the center of the  chart, and the second value maps to the distance from the center of the  chart along the radius.
    The coordinates returned are based on 0,0  being the upper-left corner of the chart. For a ColumnChart control, for  example, the height of the column is inversely related to the x  coordinate that is returned.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#localToGlobal%28%29
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#globalToLocal%28%29

  • Pie chart wedge function call

    Hi,
    I am trying to build a pie chart that will fire a custom function on rollover of the individual pie wedges.
    I need to be able to pass information about the wedge that is rolled over (i.e. a name or id) to this function.
    Thanks.

    I am close. I just need to find the right path to the wedge id.
    This is what I have so far.
    <fx:Script><![CDATA[
            import mx.charts.events.ChartItemEvent;
            private function itemClickHandler(e:ChartItemEvent):void {
                var selectedIndx:String= e.currentTarget.series.index; //<--returns null
        ]]></fx:Script>
    <s:VGroup>
            <mx:PieChart width="220" height="220" id="piechart1"
                         dataProvider="{srv.lastResult.AAFunds.fundName}"
                         itemClick="itemClickHandler(event)"
                         >
                <mx:series>
                    <mx:PieSeries  displayName="pie series 1" />
                </mx:series>
            </mx:PieChart>
        </s:VGroup>

  • How to display PIE chart Axis label horizontally?

    Hi
    Currently my PIE chart axis label is displying in 2 lines. How make it to display in one line?
    Thank you

    hi,
    For Pie chart there will be no X-axis or Y-axis terms generally.
    Label/Text could be one of the following.
    Title?
    or Sub Title?
    or Foot note?
    Right Click -> Format Title . Reduce the font size such that it fits into a single line.
    Regards,
    Vamsee

  • Pie chart wedge end position.

    Hi,
         I need one urgent help. I need to get start and end position of the wedge corner's in pie-chart. I need to draw some thing using those points. So i need thier global positions.
    Thanks,
    Sathyamoorthi.

    OK, now I get it. So you would need to place your two PieCharts in a s:Group or mx:Canvas. On top of the pie charts, lay another s:Group on which you will do some drawing on its graphics:Graphics object.
    In your case, you need to use dataToLocal() (will give you pixel coordinates in your chart) then localToGlobal()  (convert to Application coordinates) then globalToLocal() (convert to the Top Group or Canvas coordinates you want to draw in) :
    Using the dataToLocal() method
    The dataToLocal() method converts a set of values to x  and y coordinates on the screen. The values you give the method are in  the "data space" of the chart; this method converts these values to  coordinates. The data space is the collection of all possible combinations of data values that a chart can represent.
    The number and meaning of arguments passed to the dataToLocal() method depend on the chart type. For CartesianChart controls, such as the BarChart and ColumnChart controls, the first value is used to map along the x axis, and the second value is used to map along the y axis.
    For PolarChart controls, such as the PieChart control, the first value maps to the angle around the center of the  chart, and the second value maps to the distance from the center of the  chart along the radius.
    The coordinates returned are based on 0,0  being the upper-left corner of the chart. For a ColumnChart control, for  example, the height of the column is inversely related to the x  coordinate that is returned.
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#localToGlobal%28%29
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayOb ject.html#globalToLocal%28%29

  • How to show pie chart in Oracle Map?

    I created predefined theme with pie chart style using MapBuilder. When I requested map using XML map request, the pie chart are shown with background and base map behind. Unfortunately, I tried to use Oracle Maps JavaScript Client API and it showed only background with base map behind.
    I’m using this code
    themebasedfoi = new MVThemeBasedFOI('themebasedfoi1','geoadmin.pie_province ');
    themebasedfoi.setBringToTopOnMouseOver(true);
    mapview.addThemeBasedFOI(themebasedfoi);
    geoadmin is my username and pie_province is my pie chart predefined theme
    Sorry for my English
    Many thanks
    581554

    Hi
    You can create chart by chart wizard in layout model in report 6i.
    1. Create Query in data model
    2. Go Layout model and right click
    3. Select Chart Wizard then select Chart type
    4. Select Axis (X axis column and Y axis column)
    5. Choose your chart placement
    PS

  • How to create pie charts in BIP 11g using .XSL?

    Hi,
    Requirement is to create a multi sheet excel output. Because of this. I am going the XSL way and not RTF.
    Now, I need to create pie charts using XSL as part of the output.
    * Is it possible to create pie charts in .XSL? If so, any pointers?
    * I tried some SVG coding by referencing the below link but not result:
    <http://www.svgopen.org/2003/papers/CreatingSVGPieChartsThroughWebService/index.html#S2.1>
    * I also created the required chart in RTF and tried to use the underlying XSL-FO code. Not sure if I have used it in the right way. Has anyone tried doing that?
    If you have any info, please share.
    Thanks,
    Divya

    One more point : I came across a link which talks about Bar charts using XSLT :
    http://www.roguewave.com/Portals/0/products/imsl-numerical-libraries/java-library/docs/5.0.1/chartpg/xml_xslt.html
    so, I am hoping, there is a way to do pie charts as well?
    Thanks,
    Divya

  • How to display pie chart in smart forms

    hii experts,
                      my requirement is to display pi chart in smart forms . i have  googled but could not get any meaning full results. If any one knows this pls share ..
    Thanks and Regards
    Aditya Shrivastava

    Hi
    I really doubt If you did search at all in the first place. Anyhow, check this:
    https://www.sdn.sap.com/irj/scn/advancedsearch?query=piechartin+smartforms&cat=sdn_all
    Vishwa.

  • Create pie chart in jsp

    how to create pie chart in jsp based on sql server 2000 database
    please give example or code with explanation

    http://sourceforge.net/projects/jfreechart
    - Saish

  • Pie chart using Class cl_igs_chart ??

    Hi All,
    I am looking for Sample code, how to draw Pie chart using standard class: cl_igs_chart.
    I found a Standard SAP prog: GRAPHICS_IGS_CHART_TEST for drawing Bar chart, looking for pie chart now?
    Please help me!!
    Thanks in advance.

    Hi,
    if you want to create charts in the background using the IGS is the right choice!
    Let's have a look at cl_igs_chart:
    creating a pie chart can be done easily by changing the demo report graphics_igs_chart_test; just change the line
    igs_chart->type = cl_igs_chart=>co_type_bars.
    by replacing co_type_bars with co_type_pie (check the attributes of cl_igs_chart to see a list of chart types).
    However, as cl_igs_chart does not provide further customizing settings I recommend that you download the SAP Chart Designer (as mentioned above) and use the class cl_igs_chart_engine instead. Demo report is graphics_igs_ce_test.
    Regards, Kai

  • Dynamic Pie Chart in Smart Form

    Hi Frn's ,
      How can i show the dynamic Pie chart in Smartform .
    Thanks and Regards
    Priyank Dixit

    Hi,
    Refer to this link [How to display pie chart in smart forms|Re: how to display pie chart in smart forms]

  • How did Steve group exploded wedges in pie chart

    In his MacWorld keynote today, Steve showed a pie chart with 3 wedges exploded together (9:36 in, the US SmartPhone Marketshare slide). The Apple wedge is exploded, but so are the Palm, Motorola and Nokia wedges, yet they are exploded together, with no space between them. Is this possible in Keynote '08 or is Steve using unreleased features? I've tried selected all three and changing the explode value, but they separate.

    I'll post the .key file used to create that image.
    http://idisk.mac.com/makentosh-Public/multixplode.zip
    The main things to consider is:
    a) Don't move the wedges you want "connected"
    b) You'll need one "Preview Passthru" for each separately exploded bit
    So, you begin by setting up your chart with all the appropriate elements. Then, pull away the ones you DON'T want stuck together. Preview Passthru them (Copy, Open Preview, Command-N, Copy, Paste back into Keynote OR Preview Passthru for short), then use the "Draw a Shape" to click out a shape that surrounds the ones that are stuck together. Select the shape and the image and "Mask with Selected Shape". If you've only got two separated groups, move all the others back to the center, move the "attached" ones away and Preview Passthru that group, then mask it.
    You'll see how I masked all three parts in the linked Keynote file.

  • How can I evenly space wedges from an exploded pie chart?

    I'm creating a pie chart widge exploded wedges in Illustrator CS3 but I'm having trouble keeping all the wedges aligned evenly. Does anyone have any tips on doing this? My eyeing attempt is terrible.

    I think the best way is by eye and if you are trying to make one seem as if it is especially called out then you want that one not to be evenly spaced like the others.
    Like such
    If you want them all to be equally emphasized then you will do better by eye like such
    And if you want more space then it will look a bit less consistent but no more so than any other approach and making the colors lighter is not going to resolve any geometric issues.

  • I have no idea how to set up a pie chart for tracking spending with categories

    This is what I want to do to help me track my credit card spending.
    I want to make a Numbers sheet where i can jot down how much money i spent on a item, and what category that item would go with (example, food, electronics, gas, so on).
    and then i want to have a pie chart that will show much how much money i'm spending in each category and how much of a percentage of the total each category takes up of the whole.
    I have no idea how to set this up in a sheet. I tried typing it in a few times and every time i go to make a pie chart, it never shows me any of the results i want to see.
    can someone please help me set up a sheet to be able to get this information to display correctly in a pie chart?

    Brad,
    Create a table with the categories and the data (for now you can make up the data):
    Now add a chart from the Charts menu in the toolbar:
    Now click the "Add Chart Data" button just below the chart.
    Now select data (from column B) in the table.  Last trick is to click the menu at the bottom-left corner of the window and change the selection to "Plot rows as series" :
    Now add formulas to the table to properly summarize the data from your data entry table using the sumif() function.

Maybe you are looking for

  • ECC 6.0 Installation Error During Import ABAP

    Hello Guys, I am installing the Ecc 6.0 on windows 2003 Enterprise Edition I facing the following error during the installation. can you guys please help me out. here is the erro i am getting. I am here by posting the import.monitor.log and the relat

  • Missing Thread Record and Invalid Extent entry when booting

    Hi all, When I boot up my PowerBook G4 it freezes. When I boot into single user mode and run fsck -fy I get the following messages: ** /dev/rdisk0s3 ** Root file system ** Checking HFS Plus volume ** Checking Extents Overflow file. ** Checking Catalo

  • Should I upgrade my software?

    I would like to upgrade to CS4, but I am not sure what is the best thing to do considering my hardware limitations. Currently I am running CS1 (Production Premium bundle? Includes Premier Pro, After Effects, Photoshop, Illustrater, In Design, Go Live

  • Adjustments to a certain photo gone?

    Hi everyone, Recently, I reorganized my Aperture library. This consisted of moving photos around, put them into different projects or merged some. I guess this went wrong for some photos, which showed only the master after these actions, when selecte

  • Solved!== Wince 6.0---Serial Driver or Kernel Problem?

    Samsung SMDKV210 Dev Board with a LCD and 4 serial ports (COM1 to COM4). A computer sends data (in packet one by one) regularly to the board through COM1. When the interval time of the packets is over 120ms, the application run on the Dev board recei