Toggle between map types in Wave dashboards

23. February 2017 Einstein Analytics, How To 0

In Wave you can view your data on a world map; this is pretty cool if you want to see how your opportunities or cases are spreading across the world. However, it can quickly become be a lot of details if you work with opportunities or cases in the whole world. With a few tricks, you can allow your user to choose which map to view on the dashboard and thereby “zoom in” on certain areas using Wave’s different maps. This is done with a static step and modifications to your map widget.

MapSelectorDashboard

First, we need to create our map. So create your lens and clip it to your new dashboard. In my example, the step behind my map has the measure as “Sum of Amount” and my grouping is “Billing Country”.

MapSelectorLens

In the flex designer, drag your step to the canvas. In the widget section make sure to select the chart type “Maps”.

MapSelectorWidgetSettings

Now we need to create the static step. You can do this directly in the dashboard JSON or you can get a little help with step creator in the flex designer. The first step is to click on the “create step”.

MapSelectorStaticStep1

Instead of choosing your dataset choose to create a static step.

MapSelectorStaticStep2

Give your static step a name and enter the name of the map in the “display” and the “value” fields and click add. In this example, I am using “Europe” and “North America”.

MapSelectorStaticStep3

New we need to portray the new static step on your dashboard. I have chosen the toggle widget.

MapSelectorToggleWidget

With the static step added we now need to modify the dashboard JSON. To do this preview your dashboard and view the JSON by pressing command + e (for mac users) and control + e (for PC users).

Find your static step and modify it to look like this:

 "StaticStepMapSelecto_1": {
 "type": "staticflex",
 "values": [
 {
 "display": "Europe",
 "mapType": "Europe"
 },
 {
 "display": "North America",
 "mapType": "North America"
 }
 ],
 "isFacet": false,
 "useGlobal": false,
 "isGlobal": false,
 "selectMode": "singlerequired",
 "label": "StaticStepMapSelector"
 },

 

Find your map widget and modify it to look like this:

 "chart_1": {
 "type": "chart",
 "parameters": {
 "step": "StepTotalSalesCountr_1",
 "visualizationType": "choropleth",
 "title": {
 "label": "",
 "subtitleLabel": "",
 "align": "center"
 },
 "theme": "light",
 "legend": {
 "show": true,
 "showHeader": true,
 "inside": false,
 "position": "right-top",
 "customSize": "auto"
 },
 "trellis": {
 "enable": false,
 "type": "x",
 "chartsPerLine": 4
 },
 "exploreLink": true,
"map": "{{coalesce(cell(StaticStepMapSelecto_1.selection, 0, \"mapType\"), cell(StaticStepMapSelecto_1.result, 0, \"mapType\")).asString()}}",
 "lowColor": "#C5DBF7",
 "highColor": "#1674D9",
 "binValues": false,
 "bins": {
 "breakpoints": {
 "low": 0,
 "high": 100
 },
 "bands": {
 "low": {
 "label": "",
 "color": "#B22222"
 },
 "medium": {
 "label": "",
 "color": "#ffa500"
 },
 "high": {
 "label": "",
 "color": "#008000"
 }
 }
 }
 }
 },

 

Go back to preview your dashboard. Now you can toggle between the maps on your dashboard.


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.