Find Background Image Coordinates
In many scenarios, you might want to map your data onto a background image instead of on a Tableau map. This article explains how to plot data points on a background image.
There are several steps in this process:
Create a table in your data source for X and Y coordinates.
Connect to your data source in Tableau Desktop and join the coordinate table with the rest of your data.
Import your background image and build the view.
Annotate points on the background image.
Add coordinates to the coordinates table in your data source.
Refresh your data source in Tableau.
Step 1: Create the coordinate table
Create a table in your data source that contains columns to identify a unique mark. In this example, there are three columns:
The first column holds the unique identifier for each mark.
The other two columns are for the X and Y coordinates.
After you create your columns, you join the new coordinate table to the original data source. The join is based on the unique identifier used in both the original data source and the coordinate table (the identifier that represents a single mark).
Select a scale that is appropriate for your background image. If the image is wider than it is tall, use X: 0-100 and Y: 0-50.
For this example, open the Sample Superstore Excel file from your Tableau repository in Excel and select a new sheet tab.
On the new tab, put a single row in a table that contains one of the unique identifiers and the X and Y end points you selected for your two scales.
In this case, Product Sub-category is a column in Sample Superstore, and one of its members is Tables. The X endpoint is 100, and the Y endpoint is 50 because that is the scale for the background image.
Change the tab name to Coords and save the file.
Step 2: Connect to the coordinate table
In a new Tableau workbook, select Connect to Data.
In the Connect to Data dialog box, select Microsoft Excel and then click Next.
On the data source page, do the following:
Drag the Orders sheet to the Join area.
Drag the Coords sheet to the Join area.
Click the join icon to modify the existing join.
In the Join dialog box that opens, select Left, and then select Product Sub-Category for the Data Sourcecolumn, and Product Name (Coords) for the Coords column.
Close the Join dialog box, and then select the sheet tab to go to a worksheet.
Step 3: Import the background image
In the new worksheet, select Maps > Background Images, Sample - Superstore. This opens the Background Images dialog box.
In the Background Images dialog box, click Add Image.
In the Add Background Image dialog box, browse to and select the file.
For X Field, select X in the list.
Note: If you do not see the X field in the list, it means that you need to change the X field to be a continuous number.
To change the field to be a number, right-click the X field in the Data pane, and select Change Data Type > Number (Whole). To convert the field to be continuous, right-click the X field in the Data pane, and select Convert to Continuous.
Repeat these steps for the Y field.In the Right text box, type 100 (100 is the number you used in the coordinate table).
For Y Field, select Y in the list.
In the Top text box, type 50 (50 is the number you used in the coordinate table). Be sure to type in the correct text box.
Click OK, and then click OK in the Background Images dialog box. (Disregard the Valid setting of No in the Background Images dialog box.)
Step 4: Find the coordinates
From the Data pane, drag X to the Columns shelf and Y to the Rows shelf.
On the Columns shelf, right-click X and select Dimension.
On the Rows shelf, right-click Y and select Dimension.
Note: This step is only necessary if the X and Y fields were brought in to Tableau as Measures.
The background image appears in the view.
Right-click the X axis and select Edit Axis.
In the Edit Axis dialog box, select Fixed, and then in the Start text box, type 0 and in the End text box, type 100.
Click OK.
Right-click the Y axis and select Edit Axis.
In the Edit Axis dialog box, select Fixed, and then in the Start text box, type 0 and in the End text box, type 50.
Click OK.
Now the axes start at zero.
Right-click anywhere on the image where you want to find the coordinates, and select Annotate > Point.
For more information about annotating marks or points in the view, see the Add Annotations(Link opens in a new window) topic in the Tableau Help.
In the Edit Annotation dialog box, click OK.
Repeat steps 10 and 11 for each point you want to annotate.
The coordinates appear on the background image as a callout. You can move a callout to a location where it shows up better; just click and drag it. You can also resize the callout by dragging one of the size handles. You can move a coordinate point to a new location by clicking and dragging the arrowhead; the coordinates in the callout change to reflect the new location.
Add these coordinates to the Coords sheet in the Sample - Superstore Excel file and save the changes.
In Tableau, select Data > Sample - Superstore > Refresh.
The refreshed view displays marks at the coordinate locations.
If you don't want to continue to display the callouts, you can select and remove them on the background image.
Other Ideas
Try placing another Measure on the Size shelf and put either a Dimension or Measure on Colour on the Marks card. Add your own custom shapes. Develop powerful and unique analyses by creating Actions between this view and your other analyses.
If you want to hide the X and Y scales, right-click the respective field on the Columns or Rows shelf and clear Show Header.