{"id":28262,"date":"2017-02-17T03:01:53","date_gmt":"2017-02-16T17:01:53","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=28262"},"modified":"2017-02-17T17:21:26","modified_gmt":"2017-02-17T07:21:26","slug":"worldbank-api-world-country-population-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/worldbank-api-world-country-population-primer-tutorial\/","title":{"rendered":"Worldbank API World Country Population Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/worldbank_population_data.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"Worldbank API World Country Population Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/worldbank_population_data.jpg\" title=\"Worldbank API World Country Population Primer Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">Worldbank API World Country Population Primer Tutorial<\/p><\/div>\n<p>Today we&#8217;re revisiting the absolutely astonishing resource that the <a target=_blank title='Worldbank data source' href='http:\/\/wdi.worldbank.org\/'>Worldbank<\/a> <a target=_blank title='Worldbank API documentation' href='https:\/\/datahelpdesk.worldbank.org\/knowledgebase\/articles\/898581-api-basic-call-structure'>API<\/a> website provides.  Such free public sources of data are very much appreciated in our books.  <font size=1>Not so much in our pamphlets, but definitely in the books.<\/font>  Revisiting we thought, perhaps, we heard you ask <font size=1>&#8230; or were you passing wind<\/font>?   Glad you asked.  Remember when we presented <a title='PHP Worldbank Growth of Merchandise Trade Tutorial' href='#pwgomtt'>PHP Worldbank Growth of Merchandise Trade Tutorial<\/a>, as shown below?   Then, we used <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Chart<\/a> Bubble Chart to present reams of information.  Today, we again broach &#8220;reams&#8221; of Wordbank Population data per country to present a Google Chart Pie Chart report.<\/p>\n<p>On our &#8220;first draft&#8221; of this web application project we create just the one pie chart, but we do that, along the way showing you a couple of things &#8230;<\/p>\n<ul>\n<li>the &#8220;reams&#8221; of data is processed on the understanding it could be sent to an HTML iframe as a URL plonked into that iframe element&#8217;s <i>src<\/i> property <font size=1>(as if)<\/font>, or if that URL is too long then that data is plugged into the HTML form and then sent (POSTed) to that same HTML iframe (whose <i>name<\/i> is the same as the form element&#8217;s target=<i>name<\/i>) via an HTML form element whose <i>action<\/i> property is set to &#8230;<br \/>\n<code><br \/>\n<a target=_blank title='Google Chart Pie Chart' href='http:\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php'>http:\/\/www.rjmprogramming.com.au\/PHP\/PieChart\/pie_chart.php<\/a><br \/>\n<\/code>\n<\/li>\n<li>the data is presented in some way shape or form with the Pie Chart, but for all the advantages of <i>lots of information in the one place<\/i>, it does suffer a bit with <i>clutter<\/i><\/li>\n<\/ul>\n<p> &#8230; and so we try some strategies to help with those <i>clutter<\/i> issues above in blog postings to come.<\/p>\n<p>In the meantime, why not try a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/worldbank_population_data.php\" title=\"Click picture\">live run<\/a> of the underlying PHP (serverside) web application you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/worldbank_population_data.php_GETME\" title=\"worldbank_population_data.php\">worldbank_population_data.php<\/a> featuring &#8230;<\/p>\n<ul>\n<li>use of PHP <a target=_blank title='PHP file_get_contents() method information' href='http:\/\/php.net\/manual\/en\/function.file-get-contents.php'>file_get_contents()<\/a> to extract &#8230;<\/li>\n<li><a target=_blank title='JSON information from w3schools' href='https:\/\/www.w3schools.com\/js\/js_json_intro.asp'>JSON<\/a> data is extracted and parsed to help piece together that URL to the Google Chart Pie Chart, as mentioned way above<\/li>\n<\/ul>\n<hr>\n<p id='pwgomtt'>Previous relevant <a target=_blank title='PHP Worldbank Growth of Merchandise Trade Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/php-worldbank-growth-of-merchandise-trade-tutorial\/'>PHP Worldbank Growth of Merchandise Trade Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/BubbleChart\/growth_of_merchandise_trade.php\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP Worldbank Growth of Merchandise Trade Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/PHP\/BubbleChart\/growth_of_merchandise_trade.jpg\" title=\"PHP Worldbank Growth of Merchandise Trade Tutorial\"  style=\"float:left;\"  \/><\/a><p class=\"wp-caption-text\">PHP Worldbank Growth of Merchandise Trade Tutorial<\/p><\/div>\n<p>We&#8217;ve said it before, and (no doubt) we&#8217;ll say it again &#8230; there are great public data sources out there for you to explore.<\/p>\n<p>As far as international data goes the <a target=_blank title='Worldbank data source' href='http:\/\/wdi.worldbank.org\/'>Worldbank<\/a> series of statistics is great, so, thanks.<\/p>\n<p>Today we combine the Worldbank data for <a target=_blank title='Growth of Merchandise Trade 2003-2013' href='http:\/\/wdi.worldbank.org\/table\/6.1'>Growth of Merchandise Trade 2003-2013<\/a> with the wonderful <a target=_blank href='https:\/\/developers.google.com\/chart\/interactive\/docs\/index' title='Google Chart Tools provide a perfect way to visualize data on your website. From simple line charts to complex hierarchical tree maps, the chart galley provides a large number of well-designed chart types. Populating your data is easy using the provided client- and server-side tools.'>Google Chart<\/a> Bubble Chart to create (52 = (first letters of country name) 26 x 2 (concepts: Exports and Imports)) reporting charts of interest, we hope.  Again, as with any reporting subject, it is a personal thing, whether the subject matter of a report is of interest, but you could say that about so many things in life.<\/p>\n<p>So, we offer some PHP source code you could call <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/BubbleChart\/growth_of_merchandise_trade.php_GETME\" title='growth_of_merchandise_trade.php'>growth_of_merchandise_trade.php<\/a> and a <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/BubbleChart\/growth_of_merchandise_trade.php\" title=\"Click picture\">live run<\/a> link as well, the full loading of which requires patience.<\/p>\n<p><b><i>Stop Press<\/i><\/b><\/p>\n<p>Tomorrow we go over what was needed to change PHP code above to be more mobile friendly &#8230;<\/p>\n<blockquote>\n<ul>\n<li><a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/BubbleChart\/growth_of_merchandise_trade.php-GETME\" title=\"growth_of_merchandise_trade.php\" target=\"_blank\">growth_of_merchandise_trade.php<\/a> <a href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/BubbleChart\/growth_of_merchandise_trade.php-GETME\" title=\"growth_of_merchandise_trade.php\" target=\"_blank\">changes<\/a> (to cater for select event (mobile touch) functionality) and <a target=_blank href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/BubbleChart\/growth_of_merchandise_trade.php\" title='growth_of_merchandise_trade.php'>live run<\/a> link for yesterday&#8217;s web application<\/li>\n<\/ul>\n<\/blockquote>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d19609' onclick='var dv=document.getElementById(\"d19609\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/php\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d19609' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d28262' onclick='var dv=document.getElementById(\"d28262\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/google-chart\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d28262' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Today we&#8217;re revisiting the absolutely astonishing resource that the Worldbank API website provides. Such free public sources of data are very much appreciated in our books. Not so much in our pamphlets, but definitely in the books. Revisiting we thought, &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/worldbank-api-world-country-population-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,1,37],"tags":[88,513,518,932,944,997,1054,1319,1345,1460],"class_list":["post-28262","post","type-post","status-publish","format-standard","hentry","category-elearning","category-uncategorised","category-tutorials","tag-api","tag-google","tag-google-chart","tag-php","tag-pie-chart","tag-programming","tag-report","tag-tutorial","tag-url","tag-worldbank"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/28262"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=28262"}],"version-history":[{"count":7,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/28262\/revisions"}],"predecessor-version":[{"id":28288,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/28262\/revisions\/28288"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=28262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=28262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=28262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}