Results 1 to 2 of 2
  1. #1
    nat is offline Member
    Join Date
    Dec 2013
    Rep Power

    Default Making a pie chart


    I use JTable and JScrollpane in my java application, and I would like for every selected row in the scroll pane, the pie chart to be made for the values in % that the row contain.
    Can anybody help me please, with an example or a web site regarding this?


  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Northern Virginia, United States
    Rep Power

    Default Re: Making a pie chart

    You can search the web for Java pie charts. Doing one yourself should not be that hard if you are familiar with graphics and a little trig.
    Just draw a circle using drawOval method of the graphics context. Then simply draw a radius at each cumulative percentage of 2*PI radians around the circumference. The percentages in this case are the ones from your table. This assumes they add up to 100.
    You might also check out the Arc2D class.

    Last edited by jim829; 03-09-2014 at 09:43 PM.
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Similar Threads

  1. Bar Chart
    By surbjits in forum New To Java
    Replies: 2
    Last Post: 08-24-2013, 06:33 PM
  2. jfreechart plotting line chart on candlestick chart
    By amlwwalker in forum New To Java
    Replies: 0
    Last Post: 10-07-2012, 01:18 AM
  3. Need help making an applet that displays a pie chart.
    By jeskoston in forum New To Java
    Replies: 5
    Last Post: 05-14-2011, 12:33 AM
  4. Issue regarding making chart in jsf
    By maulikmodi08 in forum JavaServer Faces (JSF)
    Replies: 0
    Last Post: 03-10-2011, 04:39 AM
  5. Demo bar chart and pie chart
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-23-2008, 11:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts