Syntax
Shade [ Window window_id ]
{ layer_id | layer_name }
With expr
Graduated min_value : symbol_size max_value : symbol_size
Symbol...
[ Inflect Symbol... ]
[ Vary Size By { "LOG" | "SQRT" | "CONST" } ]
window_id is the integer window identifier of a Map window.
layer_id is the layer identifier of a layer in the Map (one or larger).
layer_name is the name of a layer in the Map.
expr is the expression by which the table will be shaded, such as a column name.
max_value is a number,
min_value is a number,
symbol_size is the point size to use for symbols having the appropriate value.
Description
The optional window_id clause identifies which Map is to be shaded; if no window_id is provided, MapBasic shades the topmost Map window.
The Shade statement must specify which layer to shade thematically, even if the Map window has only one layer. The layer may be identified by number (layer_id), where the topmost map layer has a layer_id value of one, the next layer has a layer_id value of two, etc. Alternately, the Shade statement can identify the map layer by name (for example, "world").
Each Shade statement must specify an expr expression clause. MapInfo Pro evaluates this expression for each object in the table being shaded; following the Shade statement, MapInfo Pro chooses each object's display style based on that record's expr value. The expression typically includes the names of one or more columns from the table being shaded.
The keywords following the expr clause dictate which type of shading MapInfo Pro will perform. The Graduated keyword results in a graduated symbols map.
For the specific syntax of a Graduated map, see Syntax Graduated Symbols.
In a Graduated map, the keyword Graduated is followed by a pair of value:symbol_size clauses. The first of the value:symbol_size clauses specifies what size symbol corresponds to the minimum value, and the second of the value:symbol_size clauses specifies what size symbol corresponds to the maximum value. MapInfo Pro uses intermediate symbol sizes for rows having values between the extremes.
A Symbol clause dictates what type of symbol should appear (circle, star, etc.). If you include the optional Inflect clause, which specifies a second Symbol style, MapInfo Pro uses the secondary symbol style to draw symbols for rows having negative values.
The following example creates a graduated symbols map showing profits and losses. Stores showing a profit are represented as green triangles, pointing up. The Shade statement also includes an Inflection clause, so that stores showing a net loss appear as red triangles, pointing down.
Shade stores With Net_Profit
Graduated
0.0:0 15000:24
Symbol(36, GREEN, 24)
Inflect Symbol(37, RED, 24)
Vary Size By "SQRT"
The optional Vary Size By clause controls how differences in numerical values correspond to differences in symbol sizes. If you omit the Vary Size By clause, MapInfo Pro varies the symbol size using the "SQRT" (square root) method, which assigns increasingly larger point sizes as the square roots of the values increase. When you vary by square root, each symbol's area is proportionate to the row's value; thus, if one row has a value twice as large as another row, the row with the larger value will have a symbol that occupies twice as much area on the map.