Hi
Im plotting a graph using JPGraph.
The first plotted line uses $data as its source. It works like a charm, I collect the data from a MySql database.
However, now I want to plot a new line. I want that line to use the same data but I want to add each value to the value before and so on.
This is my code that dosent work.
while ($row = mysql_fetch_array($result)) {
$data[] = $row['EF0000000DBBDD1D']*6/1000;
$data1[] = strtotime($row['DATETIME']);
$data2[] = $data2 + $data;
}
echo "-----------------------------";
print_r ($data);
print_r ($data2);
The result Im looking for is this:
$data = 2, 2, 2, 2, 2, 2, 2, 2, 2.....
$data2 = 2, 4, 6, 8, 10, 12, 14.......
I thought that this should be easy but I just cant seem to find the answer.
Any help is appreciated.