I want to draw an array of X and Y integers to a panel in a Java frame.
What is the best way to draw the line (currently I'm using Graphic's drawPolyline)?
How can I efficiently scale the integer values so they all fit in the panel area without knowing the max (Y) value?
Update, for example
public void paint(Graphics g)
{
int height = panel.getHeight();
int width = panel.getWidth();
int[] xPoints = { ... values ... };
int[] yPoints = { ... values ... };
int nPoints = dataLength;
// Scale xPoints and yPoints so they fit in the area of width and height
// and draw line
g.drawPolyline(xPoints, yPoints, nPoints);
g.dispose();
}