/**
* @version $Id: MinimalExample.java,v 1.2 2000/11/13 18:47:17 Administrator Exp $
*/
import java.applet.*;
import java.awt.*;
import com.smartmoney.webgraph.*;
public class MinimalExample
extends Applet
{
static final int ARRAY_SIZE = 300;
public void init()
{
double[] xValues = new double[ARRAY_SIZE];
double[] yValues = new double[ARRAY_SIZE];
for (int i = 0; i < ARRAY_SIZE; i++)
{
xValues[i] = i;
yValues[i] = Math.sin(2 * Math.PI * i / ARRAY_SIZE);
}
Graph graph = new NumericGraph();
DataSource dataSource = new SimpleDataSource(xValues, yValues);
GraphModel model = new GraphModel(dataSource);
GraphElement line = new LineElement(model);
graph.setMessage("Minimal Example");
graph.addGraphElement(line);
setLayout(new BorderLayout());
add(graph, BorderLayout.CENTER);
}
}