How to draw a simple pie chart?

I want to draw a simple pie chart.
I was wondering whether there already exists a method to allow me to do that in SDK 1.4.2. I saw on the net a method getPieChart( ).
Do you know if its incorporated in SDK1.4.2 and how to draw the pie chart using this method. Can anybody guide me?
Thanks.

Have a look in your demos folder in your SDK, for example:
C:\j2sdk1.4.2_04\demo\applets\GraphicsTest

Similar Messages

  • How to draw a simple line chart using GRAPH_MATRIX_2D function

    Hello,
    can anyone help me with that function please,
    i couldn't draw a line graph with three data series, i mean with three lines in the graph.
    i want to the chart to be drawn as line graph at the beginning, i shouldn't have to change the chart type later,
    can anybody send me a sample code that does what i want.
    i am expecting your answers,
    thanks.
    Note: all answers will be pointed.

    Hi Ali,
    please refer to my reply [here|Re: drawing 2d line chart problem, urgent please!!!] and skip this thread. This is a copy of the other request.
    Regards
    Matthias

  • How can we create dynamic pie chart in jsp

    hi im a new jsp programmer and i just want to know how can i create dynamic pie chart in jsp

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

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

  • How can I create a Pie charts ?

    HI all,
    I'm a beginner in java and i'm investigate in a web project (website) which should display statistical charts. I did a beans to generate basic bar charts, but it is most difficult to build a Pie chart. That's why i need help to put me on the rigth way to build Pie Charts beans (this pie charts should be filled up with db query).
    Every kind of help will be appreciated.
    Thanks in advance
    Hope someone can help me.
    STF

    I take it you constructed the bar graphs using html and images together?
    Obviously it's a little more difficult to make a pie chart with html. Chances are that it will have to be an image rendered by a Servlet or JSP. I suggest looking at how to create images using AWT or swing. This will allow you to create a circle with different color slices and what not. Then you need a Servlet or JSP that will send the image out the output stream. You can then place an image tag in your html page like this <img src="http://myserver.com/PieChartServlet>
    I'm actually working on an API myself that will render pretty histograms (line graphs), and hopefully pie charts down the road. It's going to be an open source project. I decided to make my own API when I looked at some others out there who were charging an arm and a leg for theirs. Chart Builder for example, it's like $6K for their java based API <choke>.
    So if you're interested, or anyone else is, shoot me an email and I'll let you know when the beta is ready. [email protected]
    -Derek

  • How to Get Lines in Pie Charts

    Using CF7 and WebCharts3D, and got my pie chart working. Only
    problem, I can't figure out how to get it to show LINES from the
    label of each pie slice, to the label's corresponding slice. The
    pie slice labels (descriptions) appear outside the pie chart, which
    is where I need them. But when you get a pie chart with a lot of
    slices (say 8 or more) and a lot of smaller slices close together,
    it's hard to tell which label applies to which slice. Hope this
    makes sense.
    All I need is to ADD A SMALL LINE from each label to it's
    corresponding pie slice. I've looked for options in WebCharts3D to
    do this, but can't seem to find anything (in the Decorations,
    Series, etc., sections).
    If this is possible (getting these lines to appear) could
    someone please advise how to do this? Greatly appreciate any
    help/advice. (It's probably something very easy, and I just missed
    it).
    Gary

    I was afraid of that. Just wanted to make sure I wasn't
    missing something. Thanks for the note and for confirming. Much
    appreciated.
    Gary

  • How to draw a line on chart

    Hi all,
    I am working on a chart in Design studio on BI platform. The following screen
    shot will depict the current state of my chart-
    Now
    I need to draw lines of different lengths and colors with certain distance from
    X-axis, as shown below. (I drew those lines on a screen shot of my chart with
    the help of MS paint
    but
    I need to do this with the help of design studio) . Basically I need help to
    get the following output in design studio. So, question is HOW TO DRAW A LINE
    IN DESIGN STUDIO?
    Kindly,
    help with this.
    Please suggest me to get the output.
    Thanks and Regards.
    Rakesh.

    Hi Tammy,
    Thanks for ur reply.
    I'm using DS 1.3. and no need of dynamic changes of line on chart.
    I just now gone through with CSS, but i didnt get the solution. i think somewhere im getting stuck with CSS.
    Can u please suggest me the step by step procedure to draw a line using CSS.
    Kindly help on this.
    Thanks and Regards,
    Rakesh

  • How can i create a pie chart

    Hi all,
    I'm a beginner in java and i'm investigate in a web project (website) which should display statistical charts. I did a beans to generate basic bar charts, but it's most difficult to build a pie chart. That's why i need help to put me on the right way of building a Piechart beans.
    All kind of help will be precious
    Thanks in advance.
    STF

    Thanks a lot for your reply.
    But it shall works in a beans and this was set up only for applications or applet. Besides it seems (i'm really not sure but i have found lot of thread)that an applet can't be run into a jsp page that is searching data into db (thanks to sql query)
    : there is a problem of buffer (tomcat can't generate the jsp page in the same time as it execute the applet).
    Let me know if i'm wrong or not please ?
    Regards
    STF

  • How to draw 3D/2D Surface Chart and Contour Plot using MSCHART

    Hello all
    i want to draw 3D/2D surface chart and Contour Plot using MSCHART, is that possible ?
    Please help me to sort the issue. Is there any like ?
    Thanks in advance

    As founder of Gigasoft, add our
    MS Chart Alternative to your research.  Quick 18 meg no hassle demo download will prove our bits beyond any words or pictures.

  • How to draw a simple little line.

    I have a JApplet that loads images from a jar file. This applet can scale the images, and move them left right, up and down.
    I just want to be able to draw a line on top of the images and then erase it if needed. How do I do this?
    Currently, I have a the jpg images loaded into an Image, which is then converted to an ImageIcon, which is then used to create a JLabel, which is used to create a JScrollPane which finally gets added as a tab on a JTabbedPane.
    I was told to use BufferedImage but that didn't help me. Here is what I have currently:
    private void draw()
    //Get the current image to draw on
    JScrollPane jsp = (JScrollPane)m_tabbedPane.getSelectedComponent();
    JViewport port = jsp.getViewport();
    GrabAndScrollLabel gnsLabel = (GrabAndScrollLabel) port.getView();
    ImageIcon ii = (ImageIcon) gnsLabel.getIcon();
    BufferedImage bi = new BufferedImage (ii.getIconWidth(),
    ii.getIconHeight(),
    BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = bi.createGraphics();
    g2.setPaint(Color.blue);
    g2.drawLineRect(100, 200, 300, 500);
    g2.drawImage(ii.getImage(),null,null);
    ImageIcon newIcon = new ImageIcon(ii.getImage());
    gnsLabel.setIcon(newIcon);
    port.setView(gnsLabel);
    jsp.setViewport(port);
    getRootPane().revalidate();
    getRootPane().repaint();
    Please help. I can't believe it has to be this difficult to draw a little line.
    Thanks.

    I have a little more insight into my problem.
    I built a sample form Sun (the Map_Line sample). It looks like this:
    public class Map_Line extends Applet
    private BufferedImage bi;
    public Map_Line()
    setBackground(Color.white);
    Image img = getToolkit().getImage("bld.jpg");
    try
    MediaTracker tracker = new MediaTracker(this);
    tracker.addImage(img, 0);
    tracker.waitForID(0);
    catch (Exception e)
    int iw = img.getWidth(this);
    int ih = img.getHeight(this);
    bi = new BufferedImage(iw, ih, BufferedImage.TYPE_INT_RGB);
    Graphics2D big = bi.createGraphics();
    big.drawImage(img, 0, 0, this);
    public void paint(Graphics g)
    Graphics2D g2 = (Graphics2D) g;
    int w = getSize().width;
    int h = getSize().height;
    int bw = bi.getWidth(this);
    int bh = bi.getHeight(this);
    g2.drawImage(bi, null, 0, 0);
    g2.setColor(Color.white);
    g2.setStroke(new BasicStroke(5.0f));
    g2.drawLine(10, 10, bw - 10, bh - 10);
    public static void main(String[] s)
    WindowListener l = new WindowAdapter()
    public void windowClosing(WindowEvent e)
    System.exit(0);
    Frame f = new Frame("Map_Line");
    f.addWindowListener(l);
    f.add("Center", new Map_Line());
    f.pack();
    f.setSize(new Dimension(350, 250));
    f.show();
    Note how the drawing is done in paint. This applet works just fine for me.
    The difference is that I'm trying to use the BufferedImage to get my Graphics2D object where as this one gets it from paint (casts Graphics to Graphics2D).
    This applet works just fine, but if you try to use the Graphics2D that comes back from the BufferedImage, it doesn't work!.
    For example, if I create a member variable:
    Graphics2D big;
    And then in paint do this:
    //Graphics2D g2 = (Graphics2D) g;
    Grahics2D g2 = big;
    It no longer works!
    So, it looks like I need to use something other than the
    BufferedImage.createGraphics() to get the Graphics2D object I need.
    Does this seem right?
    Thanks!

  • How to add tooltip to pie chart?

    Hello forum,
    can I show a tooltip on mouse hover on pie of chart?
    Thanks in advanced

    Solved.
    For each data:
    Tooltip toolTip = new Tooltip();
    toolTip.install(data.getNode(), toolTip);
    toolTip.setText(data.getPieValue() + "%");

  • 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 - Have no link and stop cursor from changing.

    Hi,
    I have a simple pie chart (flash) with the query:
    select
         NULL link,
         rag.meaning,
         count(wp_id)
    from ......
    For this particular chart I do no want a link from the pie chart to another page so I have defined the link as NULL. This works OK and clicking the chart does nothing (as expected).
    Unfortunately the cursor still changes from the normal arrow to a pointing finger (as it does for any other hyperlink) which may confuse the user into thinking they should be able to click here and drill down.
    How can I stop the link from existing entirely?
    Many thanks,
    Martin

    Bump

  • 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

  • Converting a pie chart to an object that is merged?

    I have created a simple pie chart as shown below (a) and in the end want it to look like a pie chart with a hollow hole in it (b).
    However, the pathfinder's minus front tool only works with 2 objects.
    The pie chart data consists of two pieces (dark teal and green). How do I merge /unite these two objects? I get an error mainly because they are not overlapping.
    (a)(b)

    Rather than physically bashing a hole through your pie chart, do it with a clipping mask like Mylenium suggests.
    The mask should be a compound path; a large circle or rectangle that completely covers the pie and a second smaller circle for the ‘hole’.
    Make a compound path of these two and apply it as a clipping mask to the pie.
    This way the pie chart remains editable.

Maybe you are looking for

  • Reposearch: a tool for finding binary repos

    Info page: http://xyne.archlinux.ca/info/reposearch After following this thread I got the idea to create a database for third-party binary repositories. I started by grabbing all of the binary repos listed on the Unofficial User Repositories wiki pag

  • Best way to transfer everything on new hard drive for mac book pro

    Hi have a mid-2009 macbook pro with 4 GB ram and 250 GB hard drive, which is full now.  I just bought 8 GB RAM to speed it up and a new 1 TB hard drive.  I am running latest Lion (that I downloaded from mac app store - I have the original install DVD

  • Mavericks 10.9.1 Upgrade = Audio issue (lost 5.1 through HDMI)

    Hello guys and gals, I've Macbook pro 15" retina connected as follow Macbook Pro -> Sony HT -> LG LED TV (55LA7400) The connection is made via HDMI port. Everything was working fine, no issue when I was using previous OS. Apps such as XBMC, etc was a

  • WatchESPN app stutters / speeds up

    Hi -- I'm running Apple TV connected to Time Warner provided wireless. My router clocks in a 30 mbps down ad 5 mbps up, verified through speed tests. When I watch ESPN through the Apple TV app, it is pretty finicky. I experience some of the following

  • HR Structural Authorization DSO's

    Hi, I have developed HR module for the first time. I need to create the authorization objects for the HR reports. I found 0PA_DS02 and 0PA_DS03 for structural authorizations in HR. I dont understand the purpose of these DSO's. Can some one explain wh