I'm having problems sending an array to jpgraph to process and then use as labels for an axis, I have the following code
page that calls the graph:
Code: Select all
$monthsYears = array("Jan", "Feb", "Mar");
echo '<img src="graphcreate.php?monthsYears='.$monthsYears.'">';
Then in graphcreate.php I have the following
Code: Select all
$monthsYears = $_GETї'monthsYears'];
$xlabels = array();
for($i = 0; $i < count($monthsYears); $i++) {
array_push($xlabels, $monthsYearsї$i]);
}
...
$graph->xaxis->SetTickLabels($xlabels);
When the graph loads, on the x axis I get the lables "A, 2, 3" I'm guessing it uses "A" cause it knows it's an array, and 2 and 3 are the default values, it should be returning "Jan, Feb, Mar" however. The array is passing fine, however a count($monthsYears) in graphcreate.php only returns 1, so for some reason the entire array doesn't seem to be getting passed, what am I missing? thankyou.