Pie chart with Quartz 2D,

Hi!
I'm trying to create a pie chart with Quartz 2D, can't find out how to do it, maybe anyone can point me in the right direction?
Thanks really much for your help!

I'm going to start the same task, I'm just reading the quartz 2d guide, but I'm thinking you can draw semicircles paths transforming the % of your data in angles, then creating paths from the end of the semicircle to the center of the circunference. sounds good for you? any comments? how was your approach?

Similar Messages

  • Pie chart with two measures and date dimension navigation not working

    Hi Experts,
    Pie chart with two measures and date dimension navigation not working. Any help is appreciated.
    Thanks
    V

    Hi Deepak,
    I had time dimension in the RPD.
    I have stacked bar chart with same time dim like year & month in the report. when I go to legand and set navigation it is working fine. But not with pie chart.
    I am not not sure what is the problem. When I click on Pie chart it is not navigating to the target report. Can it be any other issues..???

  • Pie Chart with Legend

    Hey Experts,
    I have a small issue but cannot seem to find the solution. I have a pie chart with legends which I want to show side by side (horizontally). First pie chart and then legends. My requirement is that when the window is resized, the pie chart should also resize. I am able to show the chart and legends horizontally but when the legends list is long, the pie chart is always aligned in the center vertically. I tried setting all properties such as verticalAlign = "top", verticalCenter = "false", tried putting pie chart and legends in a separate VBox but nothing seems to work. Below is the code snippet.
    I believe others would have faced this problem. Can someone help?
    <mx:HBox width="100%" height="100%" verticalAlign="top" verticalCenter="false">
         <mx:VBox width="100%" verticalAlign="top" verticalCenter="false">
              <mx:PieChart id="pieChart" width="100%" height="100%" showDataTips="true" minWidth="200" minHeight="200" verticalCenter="false"/>
         </mx:VBox>
         <mx:VBox width="100%" verticalAlign="top" verticalCenter="false">
              <mx:Legend width="100%" height="100%" dataProvider="{pieChart}"/>
         </mx:VBox>
    </mx:HBox>

    Hi Dajji,
    Here is the code which resolves the problem...
    Note: In the code below I have removed the percentage width and height for PieChart.....that resolves the problem.....but the thing here is as you resize
    your browser window the piechart width and height will not change accordingly...? Do you need PieChart to change its dimensions as your browser window
    resizes...???
    However if you specify width="100%" and height="100%" for PieChart you never gonna acheive the PieChart to be vertically alined to top.....why because
    as you specified width="100%" and height="100%" for PieChart it occupies the total dimensions of the VBox but the actual visible portion dimensions are
    less... because within the VBox you also have the legends so Flex will assign the sizes proportionately....for PieChart and Legends..
    Hope you got my point...So you should remove the width="100%" and height="100%" for PieChart then you can acheive what you needed...
    <?xml version="1.0"?>
    <!-- Simple example to demonstrate the PieChart control. -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" height="100%" width="100%">
        <mx:Script>
            <![CDATA[         
            import mx.collections.ArrayCollection;
            [Bindable]
            private var medalsAC:ArrayCollection = new ArrayCollection( [
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 },
                { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 } ]);
            private function displayGold(data:Object, field:String, index:Number, percentValue:Number):String {
                var temp:String= (" " + percentValue).substr(0,6);
                return data.Country + ": " + '\n' + "Total Gold: " + data.Gold + '\n' + temp + "%";
            ]]>
        </mx:Script>
        <mx:Panel title="Olympics 2004 Medals Tally Panel" height="100%" width="100%" layout="horizontal" verticalAlign="top">
               <mx:VBox verticalAlign="top" height="100%" width="100%">
                 <mx:PieChart id="chart"
                     showDataTips="true"
                     dataProvider="{medalsAC}">         
                     <mx:series>
                         <mx:PieSeries
                             nameField="Country"
                             field="Gold"
                             labelFunction="displayGold">
                         </mx:PieSeries>
                     </mx:series>
                 </mx:PieChart> 
               </mx:VBox>                 
             <mx:Legend dataProvider="{chart}"/>
        </mx:Panel>
    </mx:Application>
    Thanks,
    Bhasker Chari

  • Pie chart with NULL values

    I have a report(pie chart) with year, State, Category(Electronics,Home Appliances, Grocery) and % profit margin. The requirement is in a state if any of the categories is NULL the other two should become null as well for that state so that the whole pie chart will disappear. For example if electronics profit margin is NULL for a chosen state then Home appliances and Grocery profit margin should become null for that state as well. Can anyone please advise how this can be accomplished.
    Thanks
    R
    Edited by: user1146711 on Jul 13, 2012 11:37 AM

    user1146711 wrote:
    I have a report(pie chart) with year, State, Category(Electronics,Home Appliances, Grocery) and % profit margin. The requirement is in a state if any of the categories is NULL the other two should become null as well for that state so that the whole pie chart will disappear. For example if electronics profit margin is NULL for a chosen state then Home appliances and Grocery profit margin should become null for that state as well. Can anyone please advise how this can be accomplished.
    Thanks
    R
    Edited by: user1146711 on Jul 13, 2012 11:37 AMTry this:
    --1) In addition to your mentioned columns, add 4 more "% profit margin" columns. (I am assuming this is a measures column.)--
    --2) In each of the first 3 columns, click on the fx button, then on the Filters button and create a column filter "where category = 'Electronics' for the 1st column, "where category = 'Home Applicances' for the second column, etc...--
    Each of the 3 columns in step 2 will contain the measure for the specific category, for the given year, some of which may be NULL according to your data.
    --3) In the 4th dummy column, make it a concatenation of the prevous 3 columns.--
    Because this is a concatenation, if any of the previous 3 columns are NULL, the sum will also be NULL. Make sense?
    --4) Then finally, put a filter on the 4th column, "Is not Null."--
    Now if any of the individual categories has a null, the whole state will be eliminated from your report. Hide the 4 columns. That's it.
    The above won't work as the values of every row will have NULLs due to the way I said to build the report.
    Okay, try this:
    1) Build a small report with Year, State, SUM(% Profit Margin) and a concatenated column Year-State.
    2) Put a filter on the SUM(% Profit Margin) column "Is Not Null."
    If there are NULLS in any of the four categories, because your database does not substitute a 0, then the sum will be Null and there won't be a row that corresponds to that Year and State. The only rows that should appear in this report are those states for the year, that had a value in all 4 categories. The last column, Year-State will be unique and be the identifier.
    3) Now build your main report with all your normal columns (Year, State, Category, % Profit Margin) and add a hidden column that is the concatenation of Year-State.
    4) On the Year-State column, put a filter "based on another request" and point it to the "Year-State" column of the small report.
    This should produce only rows where all 4 categories had a value in it for the given year.
    Edited by: David_T on Jul 14, 2012 7:49 AM
    Edited by: David_T on Jul 16, 2012 2:48 PM

  • Pie Chart with Portal 3.0.8.9.8

    I have two portal installations, one with version 3.0.8.9.8 and the other with version 3.0.9.8.0. I have enabled the beta feature "Image Charts From Query Wizard" on both installations. I can successfully create and display a pie chart on the newer version (3.0.9.8). However, on the earlier version (3.0.8.9.8), I can only create the pie chart but it does not display. That is to say, the pie chart creation is successful, but when I run it, it times out and never displays the pie chart. Has anyone experienced problems displaying a pie chart with 3.0.8.9.8? I need to create one on this older installation since it is the version my client is using.
    Thanks,
    Kendra

    Do you have any logged error in jserv.log. Can you isolate the action of running the chart in 3.0.8.9.8 and find out corresponsing logging messages in jserv.log and error.log.

  • Pie chart With one value

    Hello Experts,
    I am new to apex.
    I want to plot a pie chart with only one value.
    that one value should look like a one slice in the pie chart.
    I tried it, but it showing as entire pie chart as one value.
    So Please help me in this regard.
    Its very urgent.
    Please.

    Hi,
    Try creating the entire chart using custom XML and PL-SQL, it will give you full control over the sql and xml . Take look at this thread Re: Help Needed : Changing the Color of Bar Graph Dynamically , Change the data_plot_settings to line and you can refer to the http://www.anychart.com/products/anychart/docs/xmlReference/index.html for more detail on the tags and syntax. Thanks.
    Regards,
    Manish

  • Pie chart with resizable slice ?

    Hello All,
    Is it possible to create a pie chart with re-sizable slice.. ie user should be able to decrease  and increase  the area of any slice by just using mouse drag. If I increase area of any particular slice, other adjacent slice should automatically get reduced.  Please provide me some pointers on this .
    Regards,
    Dharmendra

    Hi Deepak,
    I had time dimension in the RPD.
    I have stacked bar chart with same time dim like year & month in the report. when I go to legand and set navigation it is working fine. But not with pie chart.
    I am not not sure what is the problem. When I click on Pie chart it is not navigating to the target report. Can it be any other issues..???

  • Create Multiple Pie Charts with Drill Down capability(foreach in mainreport

    Hello All,
    i need to create a report with 4 pie charts, which should have drilldown capability. i tried to do that, and i can do only for two charts. i need for the rest 2 also.
    Please help.
    Thanks

    See this thread:
    BO Design studio Chart Component issue ...!! | SCN
    If Chart is bound to DS_1 and On Select event of chart is as below:
    DS_2.setFilter(dimension, CHART_1.getSelectedMember(dimension));"
    This works when you click a value on one chart it will select another.
    I haven't tried it with hierarchies.

  • XSL for a Pie chart with a very simple XML data file

    Hi All
    Using BI Pub Desktop 10.1.3.2.1 with Oracle Apps R12.1.3.
    I am trying to do a pie chart for the below data in an xml file. Normally this is pretty straight forward but with the below simple data structure I am a bit stuck, maybe thinking about it too much. Appreciate any help on what the xsl should like.
    xml file contains only the below. There is no other data in the file.
    <G2>
    <ITEM>ALL</ITEM>
    <AA>10</AA>
    <BB>20</BB>
    <CC>50</CC>
    <DD>30</DD>
    </G2>
    I want to be able to have a pie chart that shows the labels: AA, BB, CC and DD with the corresponding data values of 10,20,50 and 30.
    Thanks for viewing the question.
    Cheers Cel

    Please disregard. i went back to the original blog code and started over, and figured this out.

  • Pie Chart highlighting (immitating 3D Pie chart with ellipse shape)

    I have to create a pie chart using jdk 1.0. Since I have to make it looks like 3d, I used fillArc() to draw ellipse shape pie chart. I am having trouble highlighting the pie where the mouse is over. Using atan() to get degree of x and y mouse possition and compare to pie's degree works only for a circle but not for ellipse shape.
    Can someone tell me how I can verify xy mouse position with each ellipse pie piece?
    Also, I have to draw a label for each picese and the lavel has to point to each pie. I need to get the mid point, x and y possition, of perimiter of each pie.
    Can someone help me please?
    Thanks in advance,
    lala

    hi friends, i have developed the same appication like u but it is not 3D.so if u have 3D pie program them please send me code of programming at my mail id:
    [email protected]
    now as ur question,u can get the xy coordinate of mouse using mouseactionlistener.this u can use in ur applet coding.

  • Pie chart with both text and value

    Hi,
    I want the pie chart to contain both the text and value how is this possible when I look at the optiond for chart I was able to select only one thing at a time both not both the things at a time ,please let me know how is this possible
    Thanks
    Priya

    Hi Priya,
    this should be possible. In the Chart Designer in the properties of the Categories you must edit the Format string to e.g. "$Label$br0.00" (show the label, make a line break, show the value with 2 decimals). For more info regarding the format string see note <a href="http://service.sap.com/sap/support/notes/1064448">1064448</a>.
    Best regards
    Matthias

  • Creating a SVG Pie Chart With Different Portion Linking To Different URL

    Is it possible to create a SVG pie chart in which different portion will point to different URL. on HTML DB version 1.5.1.00.12
    For example i've tried something like this:
    on page 20 i have a svg pie chart
    select
    'f?p=&APP_ID.:21:#APP_SESSION#::::P21_DD_SALESORG:'||region,region,code from demo_region;
    i have a query in page 21 like this:
    select country from demo_country where region= :P21_DD_SALESORG;
    so when i click on a particular region on the pie chart on page 20 the value of item
    P21_DD_SALESORG on 21 should be set.
    but the value of P21_DD_SALESORG is always getting passed as NULL from the pie chart.
    I've tried it on HTML DB version 1.5.1.00.12
    Look for an early reply
    Thanks & Regards,
    Rupak
    Message was edited by:
    user445907

    hi user445907--
    your link column in your chart query seems to us the correct syntax, so i'd imagine the issue is with your data/query or the item name in question...
    check the query and data: make sure your query returns valid values to be passed of to P21_DD_SALESORG. if so, you should see your links correctly formed as you hover your mouse over the individual slices. if your links look good then check your item names.
    item names: if your links above look okay, then might you be setting the value of the incorrect item? please confirm that. after clicking a pie slice to get to page 21, check to see that P21_DD_SALESORG is correctly set by clicking the Session link in the developer toolbar.
    basically, i'm suggesting that because your link column in your query looks okay, you'd want to see at what point the NULL value is being passed/set. try tracing things from the chart query over to page 21 (and try going backwards if you have to). if you can't find the disconnect, please feel free to set up an example on an instance, where i can take a look.
    thanks,
    raj

  • How to create a pie chart with jsp/servlet?

    I want to create a servlet which can be used like below:
    <img src="pieservlet?param1=<%=x%>&param2=<%=y%>&..." width="100" height="100" >
    can you give me some guide?

    Hai ,
    I have implemented a trial working pie chart , dynamically created from jsp using ServletOutputStream , BufferedImage & JPEGImageEncoder (found in com.sun.image.codec.jpeg.* package & bundled along with jdk ) .
    <%
    ServletOutputStream sout = response.getOutputStream();
    response.setContentType("image/jpeg");
    BufferedImage img = new BufferedImage(400,400,BufferedImage.TYPE_INT_RGB);
    Graphics2D gr = img.createGraphics();
    /* Actually this will be got as values of request.getParameter */
    Vector values = new Vector();
    values.addElement(new String("45") );
    values.addElement(new String("125") );
    values.addElement(new String("75") );
    values.addElement(new String("25") );
    values.addElement(new String("90") );
    // my demo class      
    temp.pieChart fr = new temp.pieChart(400,400,values);
    /* This pieChart is class extends JFrame , in paint method of it all Drawing of pie chart using graphics2D fillArc done */
    fr.paint(gr);
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(sout);
    encoder.encode(img);
    sout.flush();
    %>
    Hope this helps to build your own custom pie chart .
    Let me know if details needed on pieChart class
    rakesh
         

  • Can you make a 'pie chart' with Lingo ?  or Java

    Question pretty much like the subject above says. Just a basic pie chart from two numbers
    Alright, I want a pie chart to give a visual of a percentage.  The percentage would be a value of 1-100 in a field cast member

    I do hope you realise that it takes more than two numbers (or one single value from a #field member, as you've supplied) to display anything representing a pie chart. For example what exactly to you want that #field value to represent? Radius? Circumference? Portion of 100%?, etc... And what is this mysterious 2nd number you hint at, but do not define?
    Please understand that while nobody would deny the integrity of any of Valentin's scripts/Xtras, you surely know that it takes much more than two numbers to represent a pie chart - or even a single slice of a given pie chart.
    But, I'll bet that his class can get you there. Just wanting you to think about what you are asking for here.
    BTW, what on earth does Java have to do with your question? Were you thinking about JavaScript when you typed the subject? You are aware that Java <> JavaScript (or even EMCA syntax), right? Were you serious about Java?
    Not a slam, just wanting you to think out loud.
    Mark "Cheers II, SD" Boyd
    Keep-On-Learnin' :-)
    .sigFile addressed at myself, but if the shoe fits...

  • Creating a donught shaped pie chart with javascript elements

    Good morning chaps,
    We recently built our new company website which we're happy enough with. However one element we tried to capture was an interactive donught shaped pie chart, using javascript to click on each seperate section.
    The end result can be viewed at;
    http://insight247.co.uk/index.php?page=aboutus
    You'll notice imemdiately that the part that's a little off is the text which sits in each section. IS there an easier way to combine the graphic, text and javascript to achieve the effect we're looking for?
    Many thanks to all responses.

    Stephen,
    There are a few strange parts: the irregular text, the irregular shapes of the underlying ring parts (which do not have consistent widths at the gaps), and the outer glow (or whatever) which correponds to a full ring on the inside but partially to separate objects on the outside.
    IS there an easier way
    Maybe not easier, but more accurate; the specific appearance is somewhat demanding.
    To get the right shape of both ring parts and letters and different choices concerning the outer glow, you may (Smart Guides are your friends):
    1) Create a fill/nostroke rectangle with the same height as the ring parts and an arbitrary length, then Object>Transform>Move a copy by the length, then Ctrl/Cmd+D to repeat 4 times;
    2) Select all six rectangles and in the Brushes palette flyout tick New Brush, select Art Brush with default settings;
    3) Create a 1pt stroke/nofill circle corresponding to the middle of the ring parts where the text bits are supposed to be, apply the Art brush to it, Object>Expand Appearance, and move the circle to the top in the Layers palette, above the Group;
    4) Direct Select each of the 6 ring parts and apply the desired colour (you may rotate later, see below);
    5) Select the stroked circle and with the Scissors Tool click where the ring parts meet (Smart Guides say intersect except at the sides where they say anchor) so you have 6 circle parts to match the ring parts, then select the 4 circle parts that are not at top and bottom and Object>Path>Add Anchor Points so you have a centre point for each of them (you had one already at top and bottom);
    6) Select one of the circle parts and with the Path Type Tool click on the centre point, then type the text bit and in the Character palette adjust the Baseline Shift once and for all (you may need to tick Show Options in the flyout);
    7) Repeat 6) for the other circle parts (except the Baseline Shift);
    8) Select the ring parts group and Effect>Stylize>Outer Glow, adjust the colour (black) and settings to make it look as desired;
    9) With the Direct Selection Tool click where two ring parts meet (avoid the Path Type) to select an end segment and Ctrl/Cmd+C+F+X+F to create a straight stroke/nofill path at the very top of the stacking order, then change the Stroke Weight to the desired width of the gap between ring parts and change the Colour to white;
    10) Repeat 9) on the opposite side of the circle, select both 9) and 10) and rotate copies twice by 60 degrees, group all;
    11) Rotate everything by 30 degrees to amtch the angles of the image.
    Now you have the final appearance with white gaps. If you want to have gaps in the same colour as the background, you may:
    12) Select everything and in the Appearance palette flyout tick Make Opacity Mask, with Clip unticked and Invert Mask ticked.
    If you want to hide the outer glow at the gaps at the outside (as in the image) or at the inside or both, you may extend the lines in 9) and 10) at either or both ends.

Maybe you are looking for

  • Creation of service entry using BAPI_ENTRYSHEET_CREATE

    Hi Experts, I have a requirement to create a service entry using BAPI with multiple account assignments. It can be distributed by quantity or percentage. Please give sample code. Thanks, Lalyn

  • How to tell what codec has been used??

    Hi Just wondering how to tell what codec a particular video clip has been encoded in? I cannot see it anywhere in bridge. after fx dos it for some but not all clips. cheers angus

  • Regular expressions to parse arithmetic expression

    Hello, I would like to parse arithmetic expressions like the following "5.2 + cos($PI/2) * -5"where valid expression entities are numbers, operations, variables and paranthesis. Until now I have figured out some regular expressions to match every typ

  • Error M7 022 "MSTB-CWESB exceeded by *** " during 109 MvT

    Hi Dears, We're using the functionality of Valuated GR blocked stock with MvT 107 and 109 for batch managed materials. First we do 107 and the batch is generated at this point creating record in MSTB. Then we do 109 against same purchase order and sy

  • Need Joystick purchase advice

    Hi, I need a new joystick. It should be - supported without fuss - have force feedback - be cheap and - someone knows the cedega config string for it. Please add your advice. Thanks.