foreach($ores as $key => $val) { $col = next($colors); if(!$col) $col = 'red'; $a[$i] = new LinePlot($val['goal']); $a[$i]->SetColor($col); $a[$i]->SetWeight(2); $a[$i]->SetLegend("Maal $key"); $a[$i]->value->Show(); $a[$i]->value->SetColor($col); $a[$i]->value->SetFormat("%.0lf"); $a[$i]->mark->SetType(MARK_X); $a[$i]->mark->SetColor($col); $a[$i]->mark->SetWidth(7); $a[$i]->mark->SetWeight(2); //Center the line plot in the center of the bars $a[$i]->SetBarCenter(); $graph->Add($a[$i]); $i++; }