383 people like it.

Exploring Population Data

Learn Key Principle of F# in just a few minutes with the following Sample of "World Bank Type Provider - Exploring Population Data"

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
13: 
14: 
15: 
16: 
17: 
18: 
19: 
//Initialize charting libraries

open Samples.Charting.DojoChart

//Load World Bank Type Provider
#r "Samples.WorldBank.dll"

//Get data context
let data = Samples.WorldBank.GetDataContext()
//Set up list of countries
let countries = 
  [ data.Countries.``Pakistan``; 
    data.Countries.China;
    data.Countries.India; 
    data.Countries.``United States`` ]

//Plot total population of selected countries
Chart.Combine([ for c in countries -> Chart.Line (c.Indicators.``Population, total``, Name=c.Name) ])
     .AndTitle("Population, 1960-2012")
val data : obj

Full name: Script.data
val countries : obj list

Full name: Script.countries
Raw view Test code New version

More information

Link:http://fssnip.net/ll
Posted:10 years ago
Author:Muhammad Mugees Asif
Tags: f#