Jump to content

jpgraph multiple series on lineplot


naeblis11

Recommended Posts

I am trying to make one graph that has multiple series or plots with a loop. However, when I run this code I get an error saying there are no points to display.

 

When I comment out the two lines at the end that clear out the arrays, I get all the data points in one series.

 

Any help would be greatly appreciated.


			while($row3=mysql_fetch_array($result3)){
				//print_r ($row3['weight']);
				$datax[]=strtotime($row3['w_date']);
				$datay[]=$row3['weight'];
			}
			// Create the linear plot 
			$lineplot[$i] = new LinePlot($datay,$datax);
			print_r($lineplot);
			// Add the plot to the graph 
			$graph->Add($lineplot[$i]); 
			$i++;
			$datax=array();
			$datay=array();

 

 

Link to comment
https://forums.phpfreaks.com/topic/87685-jpgraph-multiple-series-on-lineplot/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.