Click to view on Tableau Public – Custom Points on a Chart
When creating a map Tableau uses known points (postcodes, towns, cities etc.) to plot them onto a map but what if you want to show points on a different image?
By creating values for the X-axis, Y-axis and importing your own custom image you can achieve the same result. You could map the positions of teeth in a mouth, the bones in a body, the holes on a golf course, the positions of keys on a keyboard, the list goes on. For this demonstration I will map the network ports, IP addresses and assets at each desk in the Ipswich IG Group office. I will provide a list of instructions below to guide you through the process of how to select the points on the floor plan to attribute the data to.
Step 1: To get started you need ensure you have added two columns in your data for the X-axis and the Y-axis values to be entered. The values can be blank for now but in the first row enter 500 as the value for both the X-axis and Y-axis.
This is a temporary placeholder to help later in the process.
Step 2: Open Tableau and connect your data source.
Step 3: Create a new sheet and drag X from measures into columns, Y into rows and a unique identifier (for example tooth name, bone name, golf hole, desk number) onto the details pill. This will create a shape chart with a single value
in the top right corner.
Go to Map > Background Images and click the name of your data source. We will now add the image we want to use as our background. Click Add Image, browse and select the image you would like to use, this can be a file or a URL. For this example I will
be using an SVG.
The file I have chosen is called OfficeLayout and you can see Tableau has included an example of how the file will look in the image to the left.
Step 5: So that we can plot points on this chart we need to know which fields will generate the X-axis and Y-axis. Tableau defaults to the first field it finds that could be correct so it is likely you will have to change this. For the
X Field select X and for the Y Field select Y.
Step 6: We now need to decide on the scale for the image. The start points can be positive or negative values. For scaling reasons it is best practice to ensure that you keep the scale on the chart consistent with the scale of the image.
My image is 400 x 820 and so I multiply these values by 6. Multiply them by the same value ensures that the scale remains consistent but ensures that I can keep a greater level of control and can zoom in without losing too much definition.
I now enter the following values for the X-axis starting at 0 and finishing at 2,400 and the Y-axis starts at 0 and ends at 4,920. Next click on the options tab and select “Always Show Entire Image”. This will
ensure that when we start to enter values we can see the hole image.
Step 8: You will now have a chart with your custom image as the background and a single shape at 500 x 500. Now it’s time for the satisfying part! We are going to plot the points where you would like to show information. In this example they will be the positions of every desk within the office.
Right click on the first position where you would like to drop a marker. Select Annotate > Point and then select OK. You will now see a floating annotation point with an X-axis and a Y-axis value. Enter these values in your Excel data sheet under the X and Y column headers replacing the original values of 500 and 500.
Step 10: Refresh your data.
Step 11: Go back to your worksheet and you will notice that the point that was originally at 500 x 500 has moved to the exact point where the annotation points.
Step 12: We now need to plot the remaining points. This might seem a little repetitive but once into the swing of things you can get this done in no time at all. Top tip: You don’t need to repeatedly drop a new annotation for each point.
Click the annotation box from the first point you selected. You will see a green square at the point you selected which will now be where your first shape has appeared. Click and drag the green square to the next point and the values will change. Once
finished with the annotations just click the box and hit delete.
Step 13: Once you have entered all of the values in the Excel data sheet repeat step 10 and you will notice that all of your points have now been populated and you have a complete map.
Step 14: Add any labels and tooltip information you desire and you are finished! Click to view on Tableau Public – Custom Points on a Chart