KNOWLEDGE BASE

Building a View based on a Custom Background Map and Custom Shapes


Published: 11 Jul 2017
Last Modified Date: 20 Jul 2023

Question

How to build a view based on a custom background map and custom shapes on Tableau Desktop.

Environment

  • Tableau Desktop
  • Custom Background Map
  • Geocoding
  • Custom Shapes

Answer

This example will help you understand how to create a view with custom background and shapes using sample basketball data. With such an example, you will be able to plug/blend any new dataset to do the desired analysis based on the built-in mapping.
 
CLICK TO EXPAND STEPS
Step 1  - Setting a Background Map 
To start mapping the background, please have the desired background picture selected and ready to be used in Tableau Desktop. 
  1. Connect to your mapping (x, y) data set
  2. Click Map > Backgroun Images > Select the data source sheet that you will want to map on the image. 
  3. Browse and select your picture
  4. Configure the X and Y coordinates as you desire. For example, if the image is wider than it is tall, use X: 0-100 and Y: 0-50.
  5. Drag the position coordinates (X and Y) respectively to the Rows and Columns Shelf.
  6. Edit both axis to configure the same coordinates you used in Step 4.
  7. Right-click both axis and deselect Show Header
  8. (Optiona) Depending on the size or orientation of the picture, swap the x & y axis. 
For more information about this topic, see Select Background Maps in Tableau Help. 
 
To view the steps showed in the below video, please expand the above section.
Note: the video has no sound.
 

CLICK TO EXPAND STEPS
Step 2 - Build the view and use Custom Shapes to map your data points
  1. Add the custom shapes to Tableau Desktop repository : C:\Users\username\Documents\My Tableau Repository\Shapes. 
    • For more information, see Shape Properties in Tableau Help.
    • Please note that you need to create a subfolder and add the images in it. 
  2. Blend in the secondary data source that you would like to analyse based on the custom mapping created.
    • Note: Ensure the Linking Fields are correct.
    • In this article's example, the linking fields anre Side and Role
  3. Link the fields that are identified for the blend. 
  4. Build the view using the multiple fields you wish to display. 
    • In this article's example, the field Position ID must be dragged to Details to show the players' positions
  5. Click the Shape mark and assign the shapes. 
    1. If the shapes are not available in your selectable palettes, click Reload Shapes
  6. Adjust the Size of the Shape and color the shapes if desired. 
To view the steps showed in the below video, please expand the above section.
Note: the video has no sound.
 

CLICK TO EXPAND STEPS
Step 3 - Create the missing mapping coordinates
If your data set is missing some X and/or Y coordinates, you can easily find them from the view. 
  1. ​Right-click the position of the missing point > select Annotate > Point...
  2. Click OK in the Edit Annotation dialog. 
  3. Format how both the X and Y numbers are displayed. 
    • In this article's example, we choose to set the decimal to 4 so that the rest of our data set matches. 
  4. Add the missing X and Y data to your data source. 
  5. Refresh the data source.
For more information about finding the X and Y coordinates, see Find Background Image Coordinates in Tableau Help. 
To view the steps showed in the below video, please expand the above section.
Note: the video has no sound.
 
 

Additional Information

If you wish to share this custom mapping, save the workbook as a .twbx file before Step 6 and send it to anyone who would use the same custom maps. Different analysis based on the same custom mapping can be performed without recreating the custom mapping. Anyone who opens it locally is then able to connect to their new dataset and blend their fields to the mapping dataset fields. For more information about this topic, see Data Blending in Tableau Help. 

To view another example of custom geocoding, see this visualization in Tableau Public.
Did this article resolve the issue?