PCHomepage
Programmer
Using the JPGraph 3.5 scatter graph, I have it working and recieving data but I am not sure how to do multiple sets of data in different colors on top of each other.
The MySQL data consists of ID, FileID, DataX and DataY. The ID field can be ignored but when FileID switches from one value to the next, the graph needs to change too but right now it is all on top of each other. That is, the FileID is what differenciates between the data that needs to go into individual plots.
The mysqli query is looping through the data with:
and the data is being fed to JPGraph through a custom function with:
but how can I trigger something within the function so that it will know when the FileID is the next one and set the appropriate colors etc. for the overlay? It probably doesn't need more than five or six different plots since more would be unreadable anyway. Thank you.
The MySQL data consists of ID, FileID, DataX and DataY. The ID field can be ignored but when FileID switches from one value to the next, the graph needs to change too but right now it is all on top of each other. That is, the FileID is what differenciates between the data that needs to go into individual plots.
The mysqli query is looping through the data with:
Code:
while ($row = $result->fetch_array()) {
$datax[] = $row[2];
$datay[] = $row[3];
}
and the data is being fed to JPGraph through a custom function with:
Code:
Scatterplot($datay, $datax, $JPGraphPath);
but how can I trigger something within the function so that it will know when the FileID is the next one and set the appropriate colors etc. for the overlay? It probably doesn't need more than five or six different plots since more would be unreadable anyway. Thank you.