In this article
Use the Map widget to visualize geographically relevant data, allowing users to interact and filter data by region; support for continents and countries.
Do you have geographically relevant data that you want to visualize? For example, you may want to see the NPS for your retail stores in the US, understand response rates to your surveys in Europe, or view by-continent or by-country revenue contributions after importing revenue data into Horizons. If so, consider using the Map widget.
Example of a map widget
The Map widget currently supports data that is structured hierarchically by region. Users can interact with the map, visualizing the data using either a palette or gradient of colors, and can click to explore a region. This serves as a location filter, allowing users to filter dashboard data by the selected region and drill down geographically. The widget currently supports viewing data at the continent, country, and region level, with support for US states, Canadian provinces, and German state details at the region level.
Note
Note To visualize German state data in the Map widget, the hierarchy must be coded using ISO3166 codes. For example, Bavaria is coded as DE-BY.
Below is an example of the code to configure a Map widget.
title "Map Report"
config hub {
hub: 181
table surveyTable = p1008979.response
table hier = dbdesigner.77 // hier table id from HM
relation oneToMany {
primaryKey: hier:id
foreignKey: surveyTable:Location
}
}
config report {
formatter color mapColorFormatter {
thresholds: #F30C0C < 6, #82D854 >= 6
}
}
layoutArea toolbar {
filter hierarchy mapFilter {
label: 'Region'
hierarchy: hier:69 // hier id from HM
optionLabel: hier:language_text
}
}
page "Hierarchy" {
widget map {
label: 'Map'
size: large
type: heat
colorFormatter: mapColorFormatter
defaultColor: #FFFFFF
legendPosition: bottomRight
palette: #4C0FFF, #4C0FF2
zoomControlPosition: bottomLeft
filter: mapFilter
question: surveyTable:Location
table: hier:
value: count(surveyTable:)
}
}For details of the properties and settings, refer to widget map in the CDL Reference Guide.