I am pretty new to PHP and I am trying to use the googlechartphplib…
The api requires data to be entered in the form:
$data = new GoogleChartData(array(3450,800,700,5,50,67,1000,1250,900));
Long story short I have a PHP array that, when using:
echo '<pre>' . print_r($usersteps, true) . '</pre>';
looks like:
Array
(
[0] => 3450
[1] => 800
[2] => 700
[3] => 5
[4] => 50
[5] => 67
[6] => 1000
[7] => 1250
[8] => 900
)
What I am not sure about is getting a list values that seems to work with GoogleChartData; any ideas?
I’ve tried implode(), and the formatting looks correct but that results in a string and doesn’t seem to work.
array_values($usersteps) just returns Array.
I’m sure it’s straightforwards but I am not sure which function to use get the array data to work with GoogleChartData.
Why not use:
GoogleChartData need an array and you have one 🙂