• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Graphs

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am moving this discussion to Java in General(intermediate).
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i send you an email.
 
Tim Collins
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
email: tcollins@vtc.vsc.edu
thanks
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic