Created
March 13, 2015 08:48
-
-
Save SergeStinckwich/24c5ba61d8cd5915cc17 to your computer and use it in GitHub Desktop.
Senegal pop with M/F ratio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|tab ds b lb | | |
tab := RTTabTable new input: 'http://senegalouvert.org/data/core/Population-Senegal/r/Population%20Senegal.csv' asUrl retrieveContents usingDelimiter: $,. | |
tab removeFirstRow. | |
tab convertColumnsAsFloat: #(1 2 3 4). | |
b := RTGrapher new. | |
ds := RTDataSet new. | |
ds interaction popup. | |
ds points: tab values. | |
ds dotShape color: (Color blue alpha: 0.3). | |
ds x: [ :row | (row at: 1) - 1970 ]. | |
ds y: [ :row | row at: 3 ]. | |
ds dotSize: [ :row | (row at: 4) - (row at: 3) ] min: 5 max: 15 using: #yourself. | |
b add: ds. | |
b axisX title: 'Year'; labelConvertion: [ :v | (v + 1970) asInteger ]. | |
b axisY title: 'Million People'; labelConvertion: [ :v | (v / 1000000) round: 2 ]. | |
b build. | |
lb := RTLegendBuilder new. | |
lb view: b view. | |
lb addText: 'Population in Senegal'. | |
lb build. | |
b view. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment