Maps (Pro) include the map of China and the world map. This topic describes the basic configurations of maps (Pro).
Introduction
You can color and mark a map to display geographic data. Simple Log Service provides maps (Pro), which include the map of China and the world map. If you specify the ip_to_province or ip_to_country function in a query statement, Simple Log Service displays the query and analysis results in a map. The ip_to_province function is used to display results in the map of China. The ip_to_country function is used to display results in the world map.
A map (Pro) consists of the following elements:
Map canvas
Colored areas
Configurations on the Common Settings tab
You can configure global settings for a map on the Common Settings tab.
Parameters in the Basic Configurations section
Parameter
Description
Title
The title of the map.
Show Title
If you turn on Show Title, the title of the map is displayed.
Show Border
If you turn on Show Border, the borders of the map are displayed.
Show Background
If you turn on Show Background, the background color of the map is displayed.
Show Time
If you turn on Show Time, the time range of the query is displayed on the map.
Fixed Time
If you turn on Fixed Time, the time range of the query on the map is independent of the global time range on the dashboard.
Parameters in the Standard Configurations section
Parameter
Description
Format
The display format of numeric values.
Unit
The unit of numeric values.
Number of Digits after Decimal Point
The decimal places of numeric values.
Display Name
The display name of the map.
Color Scheme
The color scheme of the map.
Parameters in the Map Settings section
Parameter
Description
Scroll to Zoom
If you select Yes, you can scroll to zoom in or zoom out the map.
Drag
If you select Yes, you can drag the map.
Parameters in the Configure Query and Analysis section
Parameter
Description
Area/Area Code
The field that specifies a region.
The value is a code that specifies a region or a country. Example: 330000.
Value Column
The field that specifies the numeric value to be displayed.
Parameters in the Legend Configurations section
Parameter
Description
Display Legend
If you turn on Display Legend, the legend is displayed on the map.
Legend
The position of the legend on the map.
Actions
The data display effect that you want to achieve when you click a legend item.
Single: When you click a legend item, only the data that corresponds to the legend item is displayed on the map.
Switch: When you click a legend item, the data that corresponds to the legend item is hidden or displayed on the map.
Maximum Width (Height)%
The maximum width and height of the legend.
Parameters in the Replace Variable section
Parameter
Description
Replace Variable
The settings of variable replacement. You can click AddReplace Variable to add a filter of the Replace Variable type to a single chart. After you configure the settings of variable replacement on the Common Settings tab, Simple Log Service adds a filter in the upper-left corner of the chart. You can select a value from the filter drop-down list. After you select a value, Simple Log Service automatically replaces the variable in the query statement of the chart with the variable value indicated by the value that you select, and performs a query and analysis operation. For more information, see Example 2: Configure variable replacement.
Parameters in the Documentation section
Parameter
Description
Add Documentation Link
The button that allows you to specify custom document links and descriptions. After you configure this parameter, related information is displayed in the upper-right corner of the map.
Example of the map of China
Simple Log Service allows you to use the ip_to_province function to display region information in the map of China. For more information, see ip_to_province function.
* | SELECT ip_to_province(http_x_forwarded_for,'en') AS province, count(1) AS c GROUP BY province ORDER BY c desc LIMIT 100000
Set Area/Area Code to province, and set Value Column to c.
Example of the world map
Simple Log Service allows you to use the ip_to_country function to display region information in the world map. For more information, see ip_to_country function.
* | SELECT ip_to_country(remote_addr, 'en') AS address, count(1) as count GROUP BY address ORDER BY count desc LIMIT 10
Set Area/Area Code to address, and set Value Column to count.