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

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

  • 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: Legend position

    By default, the SVG pie charts that HTML DB renders show all the legends in a box off to the side of the pie.
    Is there a way to show each legend next to the slice that it corresponds to?
    Thanks

    Bump. Thanks.

  • Mouse Over Value in Pie Chart

    I have two questions -
    1. How do i restrict the no. of decimals in the Mouse Over values for Percentage in a Pie Chart ? The numeric values i can control but the percentage (which the system calculates) seems to be set at default two decimal places.
    2. While displaying the labels even though i am using the ouside end, inside end etc options - i can't seem to control the overlapping of a few labels. Offsetting is something that i need to do by hit and trial. too slow. and not all need to be offsetted. Can i selectively offset for a data point ?
    Please help....Cheers...

    Hi:
       For question1, do you mean the "Data Label->Percentage" right? I think the "Mouse-Over Values" could be set decimal places easily from  "Appearance->Text->Mouse-Over Values", but for "Data Label->Percentage" there is no direct way to show its decimal places. You can use "Label" component to build your percentage you like manually.
      For question2, if all position setting could not fit your need, you can also use label component to build your custom Data Labels.

  • Crystal Reports Pie Chart showing Sum 100% in Legend.  How to remove?

    I have a Pie chart which displays correctly but in the Legend is displayed the values with the correct percentages AND  the Sum showing 100%.
    I need to either remove the Sum line or be able to change the text from the report since I have to produce the report in 4 languages and the Sum always shows up in the language of the server.
    the legend looks something like;
    value1  25%
    value2  25%
    value3  75%
    Sum     100%   <------  this line must go or be changed  (e.g. in Italian as Totale)
    Running a server for each language is not an option
    There are a variable number of values so I cannot overlay a rectangle on a fixed position.  (awfull solution)
    Is there any way I can simply turn off the Summ (not the whole legend which is needed)?
    any help would be greatly appreciated.
    I am using Crystal Reports 2008
    Best Regards
    Chris Ryder

    Well  Thank you everyone for your suggestions.
    The client is very specific about the look and feel so I cannot change to not using a legend.  However,  the discussions serves to confirm that it is NOT possible which is actually just as useful.
    In Conclusion
    To restate the problem  the client has a report which can be displayed in one of four languages by choice from the end user.  The report contains a pie chart which displays the various segment names and percentages as a legend.  At the bottom of this legend appears automaticaly the word Summ in the langauge of the the 'Server Locale' (in our case german Summe) and the 100% value.
    I wished to know if it was possible to either change the language of this word (without changing the server as I do not have access) or to remove it altogether.
    The answer is NO it is not possible to remove only this word or to change it in anyway.
    Our final workaround is;
    we hide the Legend on the graph and build it as a seperate entity next to the graph.  Not ideal as everything is then done twice and we have an indirect link between the segment colours and the legend colours which is not apparent directly in the report.  But at least the client has signed off on the report.
    once again thank you for taking the time to think about the problem.
    Chris Ryder

  • Round Pie Chart Slice Labels

    I need to round the slice labels of my pie chart to 0 decimal places. I have looked and looked around on how to do this, and the only solution I have found does not work (using the ViewFormat element under the SliceLabel element). Here is the code for my chart. Typically, the labels end up with 2 decimal places, but some seem to randomly be rounded to 3 instead. What am I doing wrong? Any help would be greatly appreciated.
    chart:
    <Graph graphType="PIE">
    <SliceLabel textType="LD_PERCENT"/>
    <Title text="Total Compensation Package" visible="true" horizontalAlignment="CENTER">
    <GraphFont font = "Arial" size="12"/>
    </Title>
    <LegendArea position="LAP_BOTTOM"/>
    <SliceLabel visible="true">
    <ViewFormat decimalDigit="0" decimalSeparator="." decimalDigitUsed="true" decimalSeparatorUsed="true"/>
    </SliceLabel>
    <LocalGridData rowCount="2" colCount="2">
    <RowLabels>
    <Label>Annual Wages</Label>
    <Label>Benefits</Label>
    </RowLabels>
    <DataValues>
    <RowData>
    <Cell>
    <xsl:value-of select=".//CK_BENSTMT_ANNUAL"/>
    </Cell>
    </RowData>
    <RowData>
    <Cell>
    <xsl:value-of select=".//CK_BENSTMT_TOT5_ER"/>
    </Cell>
    </RowData>
    </DataValues>
    </LocalGridData>
    </Graph>

    That is exactly what I am using though, and it still doesn't work. Do I have to place the slice label element somewhere specific within the code for it to work correctly? I will try moving it around, but any other advice would be greatly appreciated.

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

  • Need help to make a Pie Chart

    I am trying to draw a pie chart for the Uptime Report.
    I have the Following table definition.
    create table downtime_detail ( env_code number, down_start date, down_end date );
    insert into downtime_detail values (1,to_date('26-JAN-2008 02:00:00','DD-MON-YYYY HH24:MI:SS'),to_date('26-JAN-2008 03:00:00','DD-MON-YYYY HH24:MI:SS') );
    insert into downtime_detail values (2,to_date('26-JAN-2008 02:00:00','DD-MON-YYYY HH24:MI:SS'),to_date('26-JAN-2008 03:00:00','DD-MON-YYYY HH24:MI:SS') );
    insert into downtime_detail values (2,to_date('01-FEB-2008 02:00:00','DD-MON-YYYY HH24:MI:SS'),to_date('03-FEB-2008 03:00:00','DD-MON-YYYY HH24:MI:SS') );
    insert into downtime_detail values (2,to_date('15-FEB-2008 02:00:00','DD-MON-YYYY HH24:MI:SS'),to_date('15-FEB-2008 03:00:00','DD-MON-YYYY HH24:MI:SS') );
    insert into downtime_detail values (2,to_date('26-FEB-2008 02:00:00','DD-MON-YYYY HH24:MI:SS'),to_date('28-FEB-2008 03:00:00','DD-MON-YYYY HH24:MI:SS') );
    Now the Below Query returns me the values val1 and val2 on the basis of which I need to draw a Pie Chart.
    ==========================================================
    select round((DOWN/TOTAL)*100,2) val1 , round(100-((DOWN/TOTAL)*100),2) val2
    from
         (select sum((DOWN_END - DOWN_START)*24) DOWN from DOWNTIME_DETAIL where ENV_CODE=2 ) a ,
         (select ((sysdate - to_date('01-JAN-2008','DD-MON-YYYY')) * 24) TOTAL from dual ) b
    VAL1 VAL2
    3.64 96.36
    ==========================================================
    Can someone help me try do this ?
    Actually I tried but I couldnt put my custom query to get this Pie chart. Or if there is any other better approach please let me know.

    nikhilskamik,
    I believe all that you are missing in your sql is a NULL. Below is the help text for creating a Flash pie chart.
    Specify the SQL query that will populate your chart, for example:
    select null, ename, sal
    from emp
    Alternatively you can write a PL/SQL function return a SQL query, for example:
    begin
    return 'select null, ename, sal from emp';
    end;
    Your query should then read:
    select null,round((DOWN/TOTAL)*100,2) val1 , round(100-((DOWN/TOTAL)*100),2) val2
    from
    (select sum((DOWN_END - DOWN_START)*24) DOWN from DOWNTIME_DETAIL where ENV_CODE=2 ) a ,
    (select ((sysdate - to_date('01-JAN-2008','DD-MON-YYYY')) * 24) TOTAL from dual ) b
    Jeff

Maybe you are looking for