*Note: The following is a guest post by Jonathan Trajkovic. *

Radar charts are a great way to compare members of a dimension in a function of several metrics. For example, when you want to buy a smartphone, you can use a radar chart to compare several devices across several metrics like battery life, camera quality, and memory capacity.

Here’s how to create a radar chart in Tableau.

## Trigonometry, my best friend ever!

To create a radar chart, we have to use trigonometry formulas—you remember the circle with Pi, and numbers, and stuff like that?

The exact formula you need depends on the number of metrics you want to display. For example, if you want to display five axes (= five metrics), your formula will differ from the one you use for a six-axis chart. In my case, I used a 12-axis chart, so I had to use several formulas as seen in the image above.

Thanks to the Internet, I was able to find the different formulas to create calculations in Tableau for the X axis and the Y axis. Here’s what they look like:

Calculation for [Xaxis]

case [Dimension]

when "Member 1" then 0

when "Member 2" then [Value] *(1/2)

when "Member 3" then [Value] *(sqrt(3)/2)

when "Member 4" then [Value]

when "Member 4" then [Value] *(sqrt(3)/2)

when "Member 5" then [Value] *(1/2)

when "Member 6" then 0

when "Member 7" then [Value] *(-1/2)

when "Member 8" then [Value] *(-sqrt(3)/2)

when "Member 9" then [Value] *(-1)

when "Member 10" then [Value] *(-sqrt(3)/2)

when "Member 11" then [Value] *(-1/2)

end

Calculation for [Yaxis]

case [Dimension]

when "Member 1" then [Value]

when "Member 2" then [Value]*(sqrt(3)/2)

when "Member 3" then [Value]*(1/2)

when "Member 4" then 0

when "Member 5" then ([Value])*(-1/2)

when "Member 6" then [Value]*(-sqrt(3)/2)

when "Member 7" then [Value]*(-1)

when "Member 8" then [Value]*(-sqrt(3)/2)

when "Member 9" then [Value]*(-1/2)

when "Member 10" then 0

when "Member 11" then [Value]*(1/2)

when "Member 12" then [Value]*(sqrt(3)/2)

end

It is very important to have the same [Value] scale for each [Dimension] member. Indeed, the 12 axes have to be the same. In my case, the scale was from 0 to 100.

## Build the radar to detect everything

After the calculations comes time to build the chart. To do this, I just have to drag and drop the [Yaxis] on the rows shelf and the [Xaxis] on the columns shelf.

Note that I use the aggregation average (because sum will return the wrong results). Here, I have only one point.

To create the radar, I have to use several dimensions—in my case, [Country] and [IndexType]. The [IndexType] dimension allows me to draw 12 axes because this is a dimension with 12 members. The [Country] dimension allows me to draw one radar by country.

If I want to draw the average radar chart, I can remove the [Country] field. To have several points, I add [IndexType] on the Mark shelf as a Level of Detail.

Then I can change the Mark to draw a polygon and add [Country] as a quick filter.

The last steps involve assigning [IndexType] as a path to follow, and fixing the axis between -110 and 110 (or whatever range you’d like to set to provide enough space between the borders and the chart).

## Some formatting, and voilà!

In my case, I made a few tweaks for the sake of design. I chose to remove the grid lines, the zero lines, and the borders. I hid the headers. At the same time, I added a border to my polygon and made the color more transparent.

Finally, I drew a background image to have a reference axis. I think it is better if you know where the maximum is.

To style the tooltip, it is important to put AVG([Value]) on the Mark shelf and to configure the tooltip like this:

And voilà! The radar chart is done!

## 评论

Hi Johnathan, a very interesting post, thank you.

I noticed that you have two number 4 members in the x axis calculation which is probably just a typo. Also it would be great if you could overlay the trigonometry diagram with the member numbers so we can see which position each formula relates to.

One last idea this gives me is to add in a label for each point / member as just looking at the shape you cannot tell what is doing better than another unless you then go an hover over each point. This would not work for the overview chart but you could then use this as a filter action for a bigger version.

Hi Johnathan,

This is a great post! Really helpful.

What if the [Value] is not in the same scale? How do I change them into one scale? by Normalization?

Thanks!

Why can't Tableau do the math for me and offer a Radar / Spider Chart? I still don't get it.

Thanks for this post- very helpful! I have a stupid question: when adding the background image, how do you calculate the X and Y bounds of the background image? When I enter the x- and y-coordinates based off of my template (-1.1, 1.1) and (-1.1, 1.1), they do not line up correctly.

This is a great great post. I'm trying to replicate it using 5 dimensions but I am not able to "replicate" the polygon when I assign "path to follow" on the very last step.

Any suggestions where I might be mistaken?

Thanks a lot

Great article but bad feedback from the author or Tableau about user comments. Fail.

Hi,

I recently tried to replicate this radar chart for 12 members. I have following suggestion for someone who is trying to do the same:

Logic provided:

Calculation for [Xaxis]

case [Dimension]

when "Member 1" then 0

when "Member 2" then [Value] *(1/2)

when "Member 3" then [Value] *(sqrt(3)/2)

when "Member 4" then [Value]

when "Member 4" then [Value] *(sqrt(3)/2)

when "Member 5" then [Value] *(1/2)

when "Member 6" then 0

when "Member 7" then [Value] *(-1/2)

when "Member 8" then [Value] *(-sqrt(3)/2)

when "Member 9" then [Value] *(-1)

when "Member 10" then [Value] *(-sqrt(3)/2)

when "Member 11" then [Value] *(-1/2)

end

Small Correction is however required

Correct Logic:

Calculation for [Xaxis]

case [Dimension]

when "Member 1" then 0

when "Member 2" then [Value] *(1/2)

when "Member 3" then [Value] *(sqrt(3)/2)

when "Member 4" then [Value]

when "Member 5" then [Value] *(sqrt(3)/2)

when "Member 6" then [Value] *(1/2)

when "Member 7" then 0

when "Member 8" then [Value] *(-1/2)

when "Member 9" then [Value] *(-sqrt(3)/2)

when "Member 10" then [Value] *(-1)

when "Member 11" then [Value] *(-sqrt(3)/2)

when "Member 12" then [Value] *(-1/2)

end

I hope this helps.

Do you simply add these formulas into a new calculated field? I'm unsure where exactly to begin setting these up.

Also, what should I be putting in for the [Value] placeholder?

You don't have to precompute all those sines and cosines.

Let Tableau do it. E.g. for 10 values:

Calculated field x:

case [Dimension]

WHEN 'Value1' then SIN(0)

WHEN 'Value2' then SIN(2*PI()/10)

WHEN 'Value3' then SIN(2*2*PI()/10)

WHEN 'Value4' then SIN(3*2*PI()/10)

WHEN 'Value5' then SIN(4*2*PI()/10)

WHEN 'Value6' then SIN(5*2*PI()/10)

WHEN 'Value7' then SIN(6*2*PI()/10)

WHEN 'Value8' then SIN(7*2*PI()/10)

WHEN 'Value9' then SIN(8*2*PI()/10)

WHEN 'Value10' then SIN(9*2*PI()/10)

END

and the same for y just replace SIN with COS.

And then you can use it for multiple measures. Simply create

MeasureX = Measure * x

MeasureY = Measure * y

David, wherever you are... you are beautiful. You just saved me A LOT of time!

However, just like Andres, I stumbled on the last step. In my case the Polygon doesn't follow the order.

Any help is appreciated.

Never mind, I figured it out, they values have to be in alphabetical order.

Thanks for posting this solution. Helped me very much!

Thanks very much!. Helped me

Hi Jonathan,

I am new to tableau. came across a requirement to create radar chart. I am able to create in excel.

Data as 9 measures and I want to create radar chart. Do you have any sample example for this?

Thanks in advance.

Regards,

Bipin

Hi Jonathan,

Thanks for this chart type. Your method is incredibly inventive.

How did you get the axes to cross at 0? I haven't discovered that feature in Tableau. Would you help me with the solution please? I need to cross two axes of equal length cross at their mid-points.

Thanks in advance.

Regards.

## 添加新评论