Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Creating pie charts  RSS feed

 
Chris Pahlman
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there an easy way to create a pie chart. I am reading data from a database and need to display in a pie chart format. Went to the sun site and would like to get the experience creating one from scratch. Thanks Chris
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"sharkcatcher",
Welcome to JavaRanch!
Please change your name to comply with the naming policy to which you agreed when you registered here..

For your publicly displayed name,
use a first name, a space, and a last name.

You can change your name:
here

You can also find the naming policy:
here
Thank You!
 
Stu Glassman
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd suggest extending Panel or JPanel. Then, simply use a succession of g.drawArc(~~~) within the paint method.
Hope this helps,
-Stu
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sitraka's JClass is ok, there are also freeware net.sourceforge.chart2d.*;
 
David Gilbert
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please try JFreeChart:
http://www.object-refinery.com/jfreechart
Complete source code included (subject to the GNU LGPL).
Regards,
Dave Gilbert
JFreeChart Project Leader
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!