SetScale( "textlin"); if (isset($_GET['text']) && !empty($_GET['text'])) { $graph->title->Set( urldecode($_GET['text']) ); $graph->title->SetColor('#c4c4c4'); } // set colors $graph->SetMarginColor('#415680'); $graph->SetBackgroundGradient('#344566','#203041',GRAD_HOR,BGRAD_PLOT); $graph->img->SetMargin(80,20 ,20,80); $graph->yaxis->SetLabelFormatCallback('yLabelFormat'); $graph->yaxis->SetColor('#c4c4c4'); $graph->xaxis->SetColor('#c4c4c4'); $graph->xaxis->SetTextLabelInterval(1); // show every date $graph->xaxis->SetLabelAngle(90); $graph->xaxis->SetTickLabels($_SESSION['session_allyhistory']['xdata']); // color array $colors = array("lightgreen","orange","red","blue","yellow","pink","brown","white","purple","black"); // Create the linear plots $i = 0; foreach ($_SESSION['session_allyhistory'][$a_what] as $id => $value) { $lineplot[$i] = new LinePlot($_SESSION['session_allyhistory'][$a_what][$id]); $lineplot[$i]->SetColor($colors[$i]); $lineplot[$i]->SetLegend(urldecode($_SESSION['session_allyhistory']['ally_array'][$id])); $graph->Add( $lineplot[$i]); $i++; } if (isset($_SESSION['session_allyhistory'][$p_what])) { // if "members" is requested, this value is not set foreach ($_SESSION['session_allyhistory'][$p_what] as $id => $value) { $lineplot[$i] = new LinePlot($_SESSION['session_allyhistory'][$p_what][$id]); $lineplot[$i]->SetColor($colors[$i]); $lineplot[$i]->SetLegend(urldecode($_SESSION['session_allyhistory']['player_array'][$id])); $graph->Add( $lineplot[$i]); $i++; } } if ($_GET['what'] == "member") { //$graph->yaxis->scale->SetGrace(300,100); $graph->yaxis->scale->SetGrace(300,0); $graph->yaxis->scale->SetAutoMin(0); } //$lineplot = new LinePlot($_SESSION['session_allyhistory']['points_aydata'][8]); //$lineplot->SetColor("lightgreen"); $graph->legend->SetFillColor('#203041'); $graph->legend->SetShadow(true); $graph->legend->SetColor('#c4c4c4'); $graph->legend->SetColumns(5); $graph->legend->Pos( 0.5, 0.95, 'center', 'bottom'); //$graph->legend->SetLayout (LEGEND_VERT); // Display the graph $graph->Stroke(); function yLabelFormat($aLabel) { if (is_numeric($aLabel)) return number_format($aLabel,0,",","."); else return $aLabel; } ?>