Skip to content

Instantly share code, notes, and snippets.

@kunjee17
Last active October 28, 2019 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunjee17/48b191951311fd2fc828e7ca0e290c95 to your computer and use it in GitHub Desktop.
Save kunjee17/48b191951311fd2fc828e7ca0e290c95 to your computer and use it in GitHub Desktop.
Famous World Bank Example
#r "../../../bin/lib/net45/FSharp.Data.dll"
#load "../../../packages/test/FSharp.Charting/FSharp.Charting.fsx"
open FSharp.Data
open FSharp.Charting
type WorldBank = WorldBankDataProvider<"World Development Indicators", Asynchronous=true>
let wb = WorldBank.GetDataContext()
let countries =
[| wb.Countries.``Arab World``
wb.Countries.``European Union``
wb.Countries.Australia
wb.Countries.Brazil
wb.Countries.Canada
wb.Countries.Chile
wb.Countries.``Czech Republic``
wb.Countries.Denmark
wb.Countries.France
wb.Countries.Greece
wb.Countries.``Low income``
wb.Countries.``High income``
wb.Countries.``United Kingdom``
wb.Countries.``United States`` |]
[ for c in countries ->
c.Indicators.``Gross capital formation (% of GDP)`` ]
|> Async.Parallel
|> Async.RunSynchronously
|> Array.map Chart.Line
|> Chart.Combine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment