C2][$DWA->C1_Y][$DWA->C1_M][$DWA->C1_D]++; foreach($_SESSION['CHART']['ARR']['DATE_CHART'] as $C2=>$C2V) { $i=0; // echo "\n wstawiam dla C2 ".$C2." dane ".$C2V; // $data_color[$C2]=RandomColorGenerator(); foreach($C2V as $C1_Y=>$C1_YV) { // echo "\n wstawiam dla C1_Y ".$C1_Y." dane ".$C1_YV; foreach($C1_YV as $C1_M=>$C1_MV) { // echo "\n wstawiam dla C1_M ".$C1_M." dane ".$C1_MV; foreach($C1_MV as $C1_D=>$C1_DV) { // echo "\n wstawiam dla ".$C1_MV." dane ".$C1_DV; $data[$C2][substr($C1_Y,-2)."-".$C1_M."-".$C1_D]=$C1_DV['COUNT']; // $data_hrs[$C2][substr($C1_Y,-2)."-".$C1_M."-".$C1_D]=$C1_DV; $i+=$C1_DV['COUNT']; //if($i>14) break; } } } $_SESSION['CHART']['ARR']['DATE_CHART'][$C2]['SIZE']=$i; $data_size[$C2]=$i; // break; } /* $data = array("1" => .0032, "2" => .0028, "3" => .0021, "4" => .0033, "5" => .0034, "6" => .0031, "7" => .0036, "8" => .0027, "9" => .0024, "10" => .0021, "11" => .0026, "12" => .0024, "13" => .0036, "14" => .0028, "15" => .0025); */ //Sortujemy i uzupelniamy daty prac o brakujace indeksy foreach($_SESSION['CHART']['ARR']['DATE_CHART'] as $user_i=>$user) { //lecimy ARR[User] foreach($user as $TABLEE_I=>$TABLE_V) { //Lecimy ARR[User][Rok] foreach($TABLE_V as $TABLEE_II=>$TABLE_VV) { //Lecimy ARR[User][Rok][m-c] foreach($TABLE_VV as $TABLEE_III=>$TABLE_VVV) { //Lecimy ARR[User][Rok][m-c][day] foreach($_SESSION['CHART']['ARR']['DATE_CHART'] as $test_user_i=>$test_user_v) { //arr[user] if(!isset($test_user_v[$TABLEE_I][$TABLEE_II][$TABLEE_III])) { echo "\n W user ".$test_user_i." tabeli ".$TABLEE_I."-".$TABLEE_II."-".$TABLEE_III." brakuje!"; $_SESSION['CHART']['ARR']['DATE_CHART'][$test_user_i][$TABLEE_I][$TABLEE_II][$TABLEE_III]['COUNT']=0; } } } } } } foreach($_SESSION['CHART']['ARR']['DATE_CHART'] as $user_i=>$user) { //lecimy ARR[User] ksort($_SESSION['CHART']['ARR']['DATE_CHART'][$user_i]); foreach($user as $TABLEE_I=>$TABLE_V) { //Lecimy ARR[User][Rok] ksort($_SESSION['CHART']['ARR']['DATE_CHART'][$user_i][$TABLEE_I]); foreach($TABLE_V as $TABLEE_II=>$TABLE_VV) { //Lecimy ARR[User][Rok][m-c] ksort($_SESSION['CHART']['ARR']['DATE_CHART'][$user_i][$TABLEE_I][$TABLEE_II]); foreach($TABLE_VV as $TABLEE_III=>$TABLE_VVV) { //Lecimy ARR[User][Rok][m-c][day] ksort($_SESSION['CHART']['ARR']['DATE_CHART'][$user_i][$TABLEE_I][$TABLEE_II][$TABLEE_III]); } } } } include('phpgraphlib.php'); $graph=new PHPGraphLib(800,400); /*foreach($data as $data_add_i=>$data_add_v) { //$graph->addData($data['gubarewp']); if($data_size[$data_add_i]>50) { $graph->addData($data[$data_add_i]); $graph->setBarColor(RandomColorGenerator()); // setLineColor("red"); $graph->setLegendTitle(substr($data_add_i,0,5)); } } */ //$_GET['C2']=stripslashes($GET['C2']); $graph->addData($data[$_GET['C2']]); $graph->setBarColor('green'); // $graph->setBarColor(RandomColorGenerator()); // setLineColor("red"); $graph->setLegendTitle($_GET['C2']); if($_GET['C22']) { $graph->addData($data[$_GET['C22']]); // $graph->setBarColor(RandomColorGenerator()); $graph->setBarColor('red'); // setLineColor("red"); $graph->setLegendTitle($_GET['C22']); } $graph->setGoalLine(100,"green"); $graph->setGoalLine(200,"red"); //$graph->setGoalLineColor("red","green"); //$graph->setTitle('Company Production'); $graph->setupYAxis(12, 'blue'); $graph->setupXAxis(20); $graph->setGrid(false); $graph->setLegend(true); $graph->setTitleLocation('left'); $graph->setTitleColor('blue'); $graph->setLegendOutlineColor('white'); //$graph->setLegendTitle('Week-37', 'Week-38'); $graph->setXValuesHorizontal(false); $graph->createGraph(); ?>