getパラメーターの値で表示を切り替えます。
<table>
<?php if($_GET["selectedDimension"] == 'continent'): ?>
<th>Continent</th><th>Users</th>
<?php
$i = 0;
foreach($c1 as $key => $value){
if($i < 10){
echo "<tr>";
echo "<td>".$key."</td><td>".$value."</td>";
echo "</tr>";
}
$i++;
}
?>
</table>
<?php elseif($_GET["selectedDimension"] == 'country'): ?>
<th>Country</th><th>Users</th>
<?php
$i = 0;
foreach($c2 as $key => $value){
if($i < 10){
echo "<tr>";
echo "<td>".$key."</td><td>".$value."</td>";
echo "</tr>";
}
$i++;
}
?>
</table>
<?php elseif($_GET["selectedDimension"] == 'city'): ?>
<th>City</th><th>Users</th>
<?php
$i = 0;
foreach($c3 as $key => $value){
if($i < 10){
echo "<tr>";
echo "<td>".$key."</td><td>".$value."</td>";
echo "</tr>";
}
$i++;
}
?>
</table>
<?php else: ?>
<th>Page</th><th>PageView</th>
<?php
$i = 0;
foreach($data as $key => $value){
if($i < 10){
echo "<tr>";
echo "<td>".$key."</td><td>".$value."</td>";
echo "</tr>";
}
$i++;
}
?>
</table>
<?php endif; ?>
continent

country

city

一人デバックしてるなー
というか、これ、ページビュー単位ではなくて、cookie単位しないと駄目だ
うおおおおおおお、結構複雑だ
cookieに重複がない場合だけ、ipの地域を取得するに変更
foreachの前で$cookie=array();と宣言します。
$cookie = array();
foreach ($cursor as $document) {
$pv[] = $document->date;
if(!in_array($document->cookie, $cookie)){
if(!is_null($document->continent)){
$c1[] = $document->continent;
}
if(!is_null($document->contry)){
$c2[] = $document->contry;
}
if(!is_null($document->city)){
$c3[] = $document->city;
}
}
$cookie[] = $document->cookie;
$session[] = $document->session;
if(!is_null($document->referrer)){
$avgtime[] = $document->avgtime;
}
if(!is_null($document->referrer)){
$referrer[] = $document->referrer;
}
$visit[] = $document->visit;
$access[] = substr($document->date, 11, 2);
$page[] = $document->page;
}
continent, country, cityがuniqueになりました。
よっしゃ、ip周りはOKそう。

次は、browser, os, service provider
これ、js、phpでとれるんか?
取れなければ、スキップとしたい。が、GAでは必ず見る項目ではある。。