Image Charts (Deprecated)

Map Chart (Deprecated Version)

 

Replacement Alert: This map chart has been replaced by a newer version.

This page describes how to create a colored map using the Charts API.

Table of Contents

Chart-Specific Features

  1. Overview
  2. United States State Codes

Standard Features

  1. Chart Title (chtt, chts)
  2. Chart Margins (chma)
  3. Background Fills
    1. Solid Fills (chf)

Overview

You can create a map with various countries or states highlighted in custom colors. To specify a map, you will specify which region of the world the map should zoom into. You will also specify a list of regions that should be colored in the map, and a parallel data list that assigns a numeric value to each corresponding country. Each country is colored along a gradient, according to the value assigned to it. You can optionally specify a custom color gradient for data values.

Map charts support the following parameters:

Parameter Required or Optional Description
cht=t Required Specifies a map chart.
chs Required Map size. Maximum size for a map is 440x220.
chtm=<zoom_area> Required

Geographical area shown in the chart.

  • zoom_area - One of the following values
    • africa
    • asia
    • europe
    • middle_east
    • south_america
    • usa
    • world
chld=<country_or_state_codes> Required

A list of countries or states to which you are applying values.

  • country_or_state codes - These are a set of two-character codes, with no delimiter in between. Use either of the following types (you cannot mix types):

Example: chld=DZEGMG

chd=<country_values> Required

A list of values parallel to the list of regions, where the value applies to the corresponding region. Values are standard formatted data values. Each region will be assigned a color along the scale specified in chco, where the lowest value in the range applies to the lowest color, and the highest value in that range applies to the last color.

  • country_values - A list in the appropriate format string. Examples: t:10,20,30, s:aU2Ff, and e:BaPoqM-A.
chco=<default_color>,<start_of_gradient>,...,<end_of_gradient> Optional

A range of colors corresponding to the low and high data values for the data format range. Data values are converted to color values along this gradient, and applied to the corresponding countries.

  • default_color - [Optional] The color of regions that do not have data assigned. The default is BEBEBE (medium gray). An RRGGBB format hexadecimal number.
  • start_of_gradient - [Optional] The color corresponding to the minimum value in the data format range. Default value is 0000FF (blue). An RRGGBB format hexadecimal number.
  • ... - [Optional] You can have as many intermediate colors as you like.
  • end_of_gradient - [Optional] The color corresponding to the maximum value in the data format range. Default is FF0000 (red). An RRGGBB format hexadecimal number
chtt, chts Optional Chart title and style
chma Optional Chart margins
chf=bg Optional Solid fills (background only)

 

Examples

Description Example

In this example:

  • The chart zoom area is Africa (chtm=africa).
  • The three countries are going to be assigned values: Algeria, Egypt, and Madagascar (chld=DZEGMG)
  • The three values assigned to those countries are 0, 100, and 50 respectively (chd=t:0,100,50), which are the minimum, maximum, and middle values for text format data.
  • The range of colors is red for 0, green for 100, and white for unassigned countries (chco=FFFFFF,FF0000,00FF00).
  • The chart also has a light blue background fill (chf=bg,s,EAF7FE).

Map of Africa
cht=t
chtm=africa
chld=DZEGMG
chd=t:0,100,50
chco=FFFFFF,FF0000,00FF00
chf=bg,s,EAF7FE

This chart is similar to the previous one, but with more detail.

Map of Africa
chtm=africa
chld=DZEGMGAOBWNGCFKECGCVSNDJTZGHMZZM
chco=FFFFFF,FF0000,FFFF00,00FF00
chd=t:0,100,50,32,60,40,43,12,14,54,98,17,70,76,18,29
chf=bg,s,EAF7FE

This chart specifies that no countries are highlighted by specifying a single, undefined value (chd=t:-1).

Map of the World
chs=440x220
chd=t:-1
cht=t
chtm=world

Back to top

United States State Codes

Here are the supported state codes when the map is zoomed into the United States (chld=usa).

AL Alabama LA Louisiana OH Ohio
AK Alaska ME Maine OK Oklahoma
AZ Arizona MD Maryland OR Oregon
AR Arkansas MA Massachusetts PA Pennsylvania
CA California MI Michigan RI Rhode Island
CO Colorado MN Minnesota SC South Carolina
CT Connecticut MS Mississippi SD South Dakota
DE Delaware MO Missouri TN Tennessee
FL Florida MT Montana TX Texas
GA Georgia NE Nebraska UT Utah
HI Hawaii NV Nevada VT Vermont
ID Idaho NH New Hampshire VA Virginia
IL Illinois NJ New Jersey WA Washington
IN Indiana NM New Mexico WV West Virginia
IA Iowa NY New York WI Wisconsin
KS Kansas NC North Carolina WY Wyoming
KY Kentucky ND North Dakota

Back to top

Standard Features

The rest of the features on this page are standard chart features.

Chart Feature List

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.