• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Java Graphs  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to draw a graph in java? If it is possible please provide
with code
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am moving this discussion to Java in General(intermediate).
 
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dinesh,
Yes, of course it is possible to draw a graph in Java... I can't really provide you with code because the question is too general... It depends on how you want to do it... Do you want to draw a bar graph, a pie chart, a line graph, etc.? You can also create a custom component that will display a graph, or just have the graph hard coded into your application. Personally, I would make a component that could be added to any application ( more OO, and easier to reuse! ) and use some type of collection inside to save all the graphs, their values and associated colors inside the component. I would then have the paint() method of the component go through all the graph values and paint them however you wanted. (points, lines between points, filled rectangles, arcs, etc. , depending on the type of graph you want...)
HTH,
-Nate
 
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at my Sine Waves... Source code included...
http://www.geocities.com/~tony-alicea/SineTest.html
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hopefully someone still looks here I see the last entry was the 16th. I need help creating a graph with a Java program/applet. Right now, I am looking at the need for a dynamic line graph, based on data that is acquired from a file. Examples would be fantastic, but a resource where I could possibly find this info would also be helpful. (ASAP)
Thanks
Tim Collins
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi please give me your email id and i can send you both line graph and bar graph they are simple but give you an idea how to do them.
 
Val Dra
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i send you an email.
 
Tim Collins
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
email: tcollins@vtc.vsc.edu
thanks
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can u please send me also the code for this chaudharygaurav@yahoo.com
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by gaurav chaudhary:
can u please send me also the code for this chaudharygaurav@yahoo.com


This link may be of interest for you. JFreeChart is a free graphing tool. Not sure how good it is, but have a look.
Jamie
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can try RChart
it includes a Visual Tool for building the charts. Then you canuse the charts very easily as servlet, applet or bean.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!