• Post Reply Bookmark Topic Watch Topic
  • New Topic

Graphs

 
Naveen Kollipara
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to generate graphs based on some input.
Is there an API tht supports this in JAVA
or is there any work around method.

Naveen
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.awt.geom package has classes like Line2D and Ellipse2D that are helpful. I found these with search:
Can you help me plzzz with a graph?
How to draw a chart with multiple y-axises
 
James Ridley
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you use a third party graphing software? JFreeChart is an open source charting library that supports multiple types of charts and is fairly easy to use.
 
peer mohamed
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to draw a graph when there is only X and Y values.........
i want to plot it
bye
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1 — scale your data to fit in the available space of your graphic component
2 — draw your abcissa and ordinate axes
3 — add tick marks and labels to the axes
4 — draw your scaled data
 
Campbell Ritchie
Marshal
Posts: 52565
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Haev you tried the Graphics class? It has a drawPolyLines() method which takes an array of x then an array of y then a count of points.
That might be what you want.
Or you can have an array of lines from the baseline to your point, from (x, y) to (baseline x, baseliney), to give a bar chart.
CR
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!