#Short description of how the library works.
Introduction
The purpose of this library is to create graphs quickly and easily. The output can be a png file or an svg file. The graph is quick configurable either with a format window from a displayed graph, or from the program that generates the function.
Details
Here is a quick example of creating a graph.
import lightgraph.Graph;
/**
* A short exmaple to demonstrate making a graph with the lightgraph library.
*/
public class GraphExample {
public static void main(String[] args){
double[] x = new double[100];
double[] y = new double[100];
double dx = Math.PI*2/100;
for(int i = 0; i<100; i++){
x[i] = dx*i;
y[i] = functionOfX(dx*i);
}
Graph graph = new Graph(x,y);
graph.show(true);
}
public static double functionOfX(double x){
return Math.sin(x);
}
}
This will create a graph that plots a function, from that graph window it is possible to format the graph, save it as a png or svg file and save the data in the graph. There is also a client for loading data.