Template:Choropleth map
Appearance
(Redirected from Template:Map)
| This template uses Lua: |
Use this template to create a choropleth map of countries.
Usage
[edit]{{Map
| region =
| width =
| height =
| color =
| countries =
}}
Parameters
[edit]|region=- Region to show in the map. If omitted, the world map will be shown. The region must be defined in the map data to be valid. Valid values for the world map are:|region=America|region=North America|region=South America|region=Central America|region=Latin America|region=Africa|region=Asia|region=Europe|region=Oceania
|width=- Width of the map. If omitted, the width will be 100%, filling the size of its container.|height=- Height of the map. If omitted, the height will be proportional to the width.|color=- Default color for colored countries. If omitted, the default color will be red.|countries=- List of countries to color (with names in English or their ISO 3166-1 alpha-2 codes) separated by commas. Each country can be followed by a value in parenthesis. If omitted, the country will be colored with the last specified color. Colors can be specified by:- A name in English, like red, blue, etc.
- A hexadecimal code, like #D8757E
- A plain number, like 400. The color will be shaded proportionally to the maximum value among all the countries.
- A percentage, like 40%. The color will be shaded proportionally.
|map=- Name of the map data to load. If omitted, the data for the world map is loaded (see Module:ChoroplethMap/world). For now, the world map is the only available.
Examples
[edit]Basic
[edit]{{Map
| countries = Brazil, Mexico, Egypt, China, Australia
}}
Regions
[edit]{{Map
| region = South America
| width = 300
| countries = Argentina, Brazil, Chile, Uruguay
}}
ISO codes and non-default color
[edit]{{Map
| color = blue
| countries = CL, ES, AR, CR, UY, MX
}}
Color groups
[edit]In this example, the first countries inherit the default color (red) and the rest inherit other colors:
{{Map
| countries =
Mexico,
United States,
Brazil,
Italy (blue),
Spain,
France,
Germany,
China (green),
India,
Australia (#faf)
}}
Color by percentage
[edit]{{Map
| region = South America
| width = 300
| countries =
Uruguay (70%),
Brazil (60%),
Chile (55%),
Peru (53%),
Argentina (48%),
Guyana (yellow)
}}
Color by value
[edit]{{Map
| region = South America
| width = 300
| countries =
UY (449),
BR (416),
CL (328),
PE (299),
AR (284),
PY (259),
BO (252),
CO (200),
VE (199),
EC (195),
SR (white),
GY,
GF
}}