Hello,
I am using phplot to create a graphical chart but I am having issues formatting my array correctly. Right now my array looks like:
Array
(
[0] => Array
(
[0] => 20100104,
[1] => 3775,
[2] => 661,
[3] => 953,
[4] => 0,
[5] => 0,
[6] => 0,
[7] => 1635,
)
[1] => Array
(
[0] => 20100104,
[1] => 3775,
[2] => 661,
[3] => 953,
[4] => 0,
[5] => 0,
[6] => 0,
[7] => 1635,
)
[2] => Array
(
[0] => 20100104,
[1] => 3775,
[2] => 661,
[3] => 953,
[4] => 0,
[5] => 0,
[6] => 0,
[7] => 1635,
)
etc, etc....
I need to get it into this format:
$example_data = array(
array('jan',3,4,2, 1),
array('march',5,3,9, 8),
array('april',7,2,6, 3),
array('may',8,1,4, 5),
array('june',2,4,6, 1),
array('july',6,4,5, 8),
array('aug',7,2,3, 4)
);
Instead of the actual text for the month in my array I am using a date. My data is stored in a db like the following:
PROD | COUNT | DATE
-------------------------------
ABC | 1234 | 20130101
-------------------------------
XYZ | 4321 | 20130101
-------------------------------
ABC | 6789 | 20130102
-------------------------------
XYZ | 9876 | 20130102
Seems like this would be easy enough to query correctly out of the DB but I am not having any luck.
any insight would be appreciated....
Thanks,
j