function country_population_graph ($country_list, $data_source
{
# ------- The external data comes from elsewhere, load it....
if ($data_source=='geonames') {
$valuesgeonames_populations$country_list);
} else if ($data_source=='freebase') {
$valuesfreebase_populations$country_list);
} else {
$valuesxithm_world_stats_population$country_list);
}
ksort$values);
// how much rounding to do for the numbers on the y-axis
$zeroes = strlen""roundmax$values)))-2;
$divs = roundmax$values)/10, $zeroes*-1);
$chrt = new stdClass
$chrt->cht = "bvs"
$chrt->chds = "0,"max$values);
$chrt->chxt = "x,y"
$chrt->chs = "600x300"
$chrt->chbh = "a"
$chrt->chxr = "1,0,"max$values).","$divs
$chrt->chxl="0:|"implode"|", array_keys$values));
$chrt->chd = "t:"implode",", $values);
return $chrt
}