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

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 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>

  • 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 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>

  • Problem with wedge in Pie chart

    Hi all,
    i'm having a Pie chart which has some four or five sections. By using wedge option i'm able to cut out a single piece from the whole chart. But my requirement is i need to show all pieces individually. Is it possible? Please help me in this.
    Kind regards,
    karthick

    Hi Karthick,
    it is not impossible, but it is not very easy to accomplish this. First of all, the chart engine (Corda PopChart) is bounded by OBIEE. What I mean is that OBIEE doesn't use the full functionality of the chart engine, so when you want to customize the chart, beyond the functionality OBIEE uses, then there is no other option then to edit the PopChart XML files (.pcxml). In ..\OracleBI\web\app\res\s_oracle10\popbin\ and ..\OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\s_oracle10\popbin you can find pie.pcxml which defines the pie chart.
    About your problem: you want to explode all wedges in your pie chart. According to the Corda documentation you can only explode one wedge, but it is possible to create a pie chart with gaps between all wedges and you can also set the size of the gap. So by setting these parameters I guess you can get what you want.
    Example: You need to add ShowPieGap='True' to this line in the .pcxml.
    <Properties Effect='2D' EffectPercentX='10' EffectPercentY='60' OutlineType='Darker' ShowPieGap='True'/>I also recommend you to read John's experiences with editing PCXML of Corda:
    http://obiee101.blogspot.com/search/label/CORDA
    http://obiee101.blogspot.com/search/label/PCXML
    Regards,
    Stijn

  • Pie chart highlight selected wedge.

    I am trying to highlight the current clicked wedge in a pie
    chart by changing the property "outerRadius" of the item
    (PieSeriesItem). But it has no effect... My idea is to expand the
    wedge a bit above the others. Is there any other method? Where
    should I go in the doc to find this?

    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 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.

  • Pie Chart Color Scheme

    Post Author: Janice
    CA Forum: Charts and Graphs
    I have a report written in Crystal Reports XI that has a pie chart in the Report Header displaying counts of activity by "reason code" for a selected time period.  The users have noticed that, when they run the report for different time periods, the same "reason" has a different color on each report.   It seems that the default is to sequence colors based on volume (size of 'pie wedge').
    They would like to have the colors appear linked to Reason Code rather than to volume.  Is there a way to change the pie chart color scheme so that it is coded by "description" not by "count"?

    hi,
    As you are selecting 'Color Highlight' for different Pie Slices,  "For all records" option shouldn't be selected.
    It should be "On Change of".
    Then obviously you will see the colors specified in 'Color Hghlight' tab.
    Regards,
    Vamsee

  • Pie Chart - Adding Colors

    I have created what should be a simple pie chart, with 8 pieces to the pie. I chose the following options for my chart: "Chart Colors, 3D Texture Fills, Fun." Unfortunately, only 6 colors are showing up. I have tried every way I can think of to add colors and have been able to physically change colors on the chart - but not with "Texture Fills."
    Any help out there for this?
    Thanks,
    rlbier

    True the Chart color option only offers 6 colors however you can set colors using the color palette.
    Open the color selector:
    +Menu > View Show Colors > select a color sample > drag onto a wedge+
    Repeat for all the wedges.
    You will have to redo all this if you change the chart type, so leave till last after you have sorted out the overall appearance.

  • Pie chart explode by grouping.

    Hi,
         Again i come here with pie-chart problem. I want to explode wedges by grouping.
         For example if i give 5 values.
         1.ClassA - Boys => 15
         2.ClassB - Boys => 20
         3.ClassC - Boys => 3
         4.ClassA - Girls => 14
         5.ClassB - Girls => 20
         Pie chart need to show it as 5 pieces. But i need to separate Boys and Girls and need to show them as 2 parts.
         When i give perWedgeExplodeRadius to certain piece, that is totally explode from the chart. Insteat of that i need to explode 1 corner.

    Hi all,
         i am still struggle in this. Any ides?

  • Appleworks SS pie chart labeling

    I cannot override the "Series 1-7" labels that serve as the default legend in my pie chart. The data wedges in color (with their percents) are fine, the title of the chart is fine. I just want to put four cells of names (column A) in place of the "Series" messages.

    Hi 'rider,
    Welcome to Apple Discussions and the AppleWorks forum.
    Select the cells containing the names (in Col. A) and the cells containing the data (in col. B). Press command-M to Make chart.
    Select Pie Chart, then Click the General button.
    In the General pane, click the radio button for Series in: Rows, and check the box for Use numbers as labels in First column.
    Click OK.
    Regards,
    Barry

  • Partial pie chart build

    Hi Folks,
    I need to have a 3D pie chart and then animate only the amount of the pie I want to show, not the rest of it. I have tried creating a pie chart and made the proportions to equal 100%. By animating the build in as 3D grow I can make the wedges come in, but I only want the first wedge, not the second: I then want to get rid of that chart and have another chart do the same thing with different numbers. Anyone got any idea how I may do this?
    Many thanks,
    Colin

    In the Build Inspector, select Delivery by Wedge, and then in the Build From section, choose "First" as the start, and "1" as the end. This has the effect of building in only the first wedge (you can also build in various contiguous subsets of the wedges as well).

  • Draggable Pie Chart

    Hi everyone,
    I'm new to Flex, and I see that creating a pie chart is
    normally very easy with the Pie Chart component. However, I need to
    create a pie chart where the edges of the slices are draggable. In
    other words, I want the user to be able to resize slices
    dynamically. Would there be any way to utilize the Pie Chart
    component for this task, or would I need to start from scratch? Any
    ideas on where to start?
    Thanks!

    Hey visit
    http://shaileshmakwana.blogspot.com/2010/04/draggable-wedges-in-pie-chart.html

Maybe you are looking for

  • Proforma Invoice - Partial Amount. Is it possible ?

    Posted: Tue Jan 22, 2008 3:21 pm    Post subject: Proforma Invoice - Partial Amount. Is it possible ?     Hi, Here is our scenario. We create sales order for very large Roofing jobs. Sales order will have 1 or 2 Items. However, each item has Billing

  • Extra power cable needed for a SATA drive in a G4 AGP "Sawtooth"?

    If one adds a SATA controller card and a SATA hard drive to a G4 AGP "Sawtooth", will a power cable like the one at the below link be needed, or would the necessary power cabling ordinarily come with the drive? [http://eshop.macsales.com/item/Micro%2

  • What is the best practice to create tabs ?

    I need help on this issue please, I need to create 3 different tabs, each one wih different content : 1) plain text 2) small form 3) flash app What is the best practice ? thanks in advance...

  • Network error when opening EAS console

    Hi All, I installed the Hyperion successfully. When I start the Essbase Administration Services Console, I get the following error as *"ERROR - 1042006 - Network error [111]: Unable to connect to [localhost:1423]. The client timed out waiting to conn

  • Unknown Flex SDK: "Flex 3.1"

    I just upgraded my flex to Build 3.0.2.214193 and I get the following error when i import my project archive.  Why is that.  Is there anything i need to change?