i'm trying to build a chart using "panachart" as the renderinig script, and what i'm trying to do is to fill the array values from a database. but with no success...
the chart should show the "days of the week" in the X bar, the "Response time" in the Y bar, and with values i will generate the lines for the chart to display. there are 3 lines to be generated, that are fix, and coming from the result of the MySQL database.
I run the following query to retrive the values :
The problem is the following :
In the panachart script i need to have 3 arrays : One for the values,
Code: Select all
$sql = "
SELECT avg( `transaction_response_time` ) , `theDate` , Left( `search_opt` , 17 ) AS trans
FROM `kpi`
WHERE ( ".$_REQUEST['period']." ) AND `transaction_response_time` != '++++++++'
GROUP BY `trans` , `theDate`
ORDER BY `theDate` ASC
";Code: Select all
if ($_POST['Submit']){
while ($res_data = mysql_fetch_array($results))
{
print_r($res_data);
}Code: Select all
Array
(
[0] => 2.0351984732824
[avg( `transaction_response_time` )] => 2.0351984732824
[1] => 2005-09-12
[theDate] => 2005-09-12
[2] => Transaction OPSea
[trans] => Transaction OPSea
)
Array
(
[0] => 2.7655852272727
[avg( `transaction_response_time` )] => 2.7655852272727
[1] => 2005-09-12
[theDate] => 2005-09-12
[2] => Transaction Login
[trans] => Transaction Login
)
Array
(
[0] => 5.334
[avg( `transaction_response_time` )] => 5.334
[1] => 2005-09-12
[theDate] => 2005-09-12
[2] => Transaction Selec
[trans] => Transaction Selec
)
Array
(
[0] => 5.4144186046512
[avg( `transaction_response_time` )] => 5.4144186046512
[1] => 2005-09-13
[theDate] => 2005-09-13
[2] => Transaction Selec
[trans] => Transaction Selec
)
Array
(
[0] => 1.9378790322581
[avg( `transaction_response_time` )] => 1.9378790322581
[1] => 2005-09-13
[theDate] => 2005-09-13
[2] => Transaction OPSea
[trans] => Transaction OPSea
)
Array
(
[0] => 3.6729545454545
[avg( `transaction_response_time` )] => 3.6729545454545
[1] => 2005-09-13
[theDate] => 2005-09-13
[2] => Transaction Login
[trans] => Transaction Login
)
Array
(
[0] => 3.4138620689655
[avg( `transaction_response_time` )] => 3.4138620689655
[1] => 2005-09-14
[theDate] => 2005-09-14
[2] => Transaction Login
[trans] => Transaction Login
)
Array
(
[0] => 5.7533181818182
[avg( `transaction_response_time` )] => 5.7533181818182
[1] => 2005-09-14
[theDate] => 2005-09-14
[2] => Transaction Selec
[trans] => Transaction Selec
)
Array
(
[0] => 1.9585230769231
[avg( `transaction_response_time` )] => 1.9585230769231
[1] => 2005-09-14
[theDate] => 2005-09-14
[2] => Transaction OPSea
[trans] => Transaction OPSea
)
Array
(
[0] => 5.3420454545455
[avg( `transaction_response_time` )] => 5.3420454545455
[1] => 2005-09-15
[theDate] => 2005-09-15
[2] => Transaction Selec
[trans] => Transaction Selec
)
Array
(
[0] => 2.0540839694656
[avg( `transaction_response_time` )] => 2.0540839694656
[1] => 2005-09-15
[theDate] => 2005-09-15
[2] => Transaction OPSea
[trans] => Transaction OPSea
)
Array
(
[0] => 2.3190454545455
[avg( `transaction_response_time` )] => 2.3190454545455
[1] => 2005-09-15
[theDate] => 2005-09-15
[2] => Transaction Login
[trans] => Transaction Login
)
Array
(
[0] => 1.7000991735537
[avg( `transaction_response_time` )] => 1.7000991735537
[1] => 2005-09-16
[theDate] => 2005-09-16
[2] => Transaction OPSea
[trans] => Transaction OPSea
)
Array
(
[0] => 2.8664197530864
[avg( `transaction_response_time` )] => 2.8664197530864
[1] => 2005-09-16
[theDate] => 2005-09-16
[2] => Transaction Login
[trans] => Transaction Login
)
Array
(
[0] => 5.1522195121951
[avg( `transaction_response_time` )] => 5.1522195121951
[1] => 2005-09-16
[theDate] => 2005-09-16
[2] => Transaction Selec
[trans] => Transaction Selec
)What is the step to do?
Thanks all for your contribution...