XPlot


Google Geo charts

This example shows how to create geo charts and line charts using the XPlot.GoogleCharts library.

To create a geo chart, use the Chart.Geo function. As usual, you can specify additional options of the chart using Chart.WithOptions including properties such as title, legend and so on. More interestingly, this also lets you specify color axis (for filling countries with a range of colors) and it lets you provide the region parameter for displaying only a part of the world.

A simple geo chart

The following example calls Chart.Geo with a list of key value pairs. Google Charts automatically recognize country names and country codes, so the following readable code works just fine:

1: 
2: 
3: 
4: 
5: 
6: 
7: 
let pop =
  [ "Germany", 200; "United States", 300
    "Brazil", 400;  "Canada", 500
    "France", 600;  "RU", 700 ]
pop
|> Chart.Geo
|> Chart.WithLabel "Popularity"
Fork me on GitHub