create a graph using 2-d array

hi

ive got a 2-d array ( or just two 1-d arrays if its easier) and i want to draw a graph using their values, there are about 1600 values. Problem is i dont really want to use an applet or have to download more software/packages; i want to ideally use the .swing and.awt and similar

Any help gratefully recieved,

Cheers!!!

[347 byte] By [nugstara] at [2007-10-1 4:04:04]
# 1

A 2D array and 2 1D arrays are not in any sense the same thing. Do you mean to say that you have an array of 2D points (or x,y pairs)?

When you say draw a graph, do you mean draw a set of edges between nodes like in a directed graph or do you mean a graph like a graph of a function like they teach about in high school?

If it is the latter, do you need to draw axis, tic marks, labels, and all the other stuff that typically goes on a graph or do you just want to draw a line between a bunch of points?

Do you need a scatter plot, a histogram, or just a line between the points?

If you just want to draw the line between the points, are the points already in order and scaled to some screen coordinate system or are they just some pile of numbers that came from somewhere?

Can you do this all in Swing or Awt without using a software package? Well, yes, but if you did not understand all of the questions that I asked, it is unlikely that you will ever figure out how to do it. And if you did understand all of the questions that I asked, then you know that it will be a fair amount of code to write and you gotta be asking yourself, why would you want to write that code rather than use a package that someone else has written to do that.

marlin314a at 2007-7-9 0:27:41 > top of Java-index,Other Topics,Algorithms...
# 2

wow. . . alot of questions there, ok, well its a 2d array of x, y pairs. . . its a line graph im wanting and i think i need to use the drawLine() method. I know how to do the axisand label them. . one of my problems is that the coordinates are doubles not ints and the awt method does not seem to support this

nugstara at 2007-7-9 0:27:41 > top of Java-index,Other Topics,Algorithms...
# 3
scale your values either to int: x = (int)(widthOfGraph * (xValue - xMin) / (xMax - xMin));or use floats and java.awt.geom.GeneralPath.lineTo(x, y).Pete
pm_kirkhama at 2007-7-9 0:27:41 > top of Java-index,Other Topics,Algorithms...
# 4
hello sir i am sending mail for how to create the bar chart in jsp. plz give the properanswer the source code. Bhooppandra
bhooppandraa at 2007-7-9 0:27:41 > top of Java-index,Other Topics,Algorithms...
# 5
> hello sir> i am sending mail for how to create the bar> e the bar chart in jsp. plz give the proper> answer the source code.> Plz deposit proper amount in my bank account.
RadcliffePikea at 2007-7-9 0:27:41 > top of Java-index,Other Topics,Algorithms...