I'm making a line graph with PHP using imagecreate() and imageline(). Im' trying to figure out how to do the calculation to find the y-axis for each point on the graph.
Here are a few values that would go in the graph:
$values[jan] = .84215;
$values[feb] = 1.57294;
$values[mar] = 3.75429;
Here is an example of the line graph. The x-axis labels are positioned at the vertical middle of the x-axis lines. The gap between the x-axis lines is 25px.
How would you do the calculation to find the y-axis for the values in the array above?
5.00
4.75
4.50
4.25
4.00
3.75
3.50
3.25
3.00
2.75
2.50
2.25
2.00
1.75
1.50
1.25
1.00
0.75
0.50
0.25
0.00
Jan Feb Mar apr may jun jul aug sep oct nov dec