<< Back

Radar Charts in Tableau – Part 3

I’m going to return to the concept of Radar Charts today, with part 3 of the series – you’d never imagine that we could keep talking about such a Tableau-taboo chart type, but we have!

To refresh, in Part 1 I showed how you could use a background image for the ‘web’ of the chart, whereas in Part 2, Chris used Alteryx to create the background image. I was considering showing how you could create the web in R, but Phillip Burger made that unnecessary.

So, where can we go from here? The obvious step is to do away with the background images, and bring the web creation into Tableau itself. Sounds simple, and in theory it is. However, I wanted to also make something that could easily be picked up and dropped into any workbook without required a high level of skill to implement. I wanted the solution to have that “Tableau” feel to it, which is a concept I am coming to appreciate recently more and more.

So without further ado, I present my solution – I’ll go into more detail after. One point – since I’m producing a tool, I’ve purposefully used fake data, so don’t try to gain great insight into the cars!

 

Still here? Hopefully the viz has sparked your interest. Next steps – how it is made and how to use it

How the viz was made

The first point is obviously the data – without the right data, the viz can’t happen. The method I went for is to separate the background data and the chart data in an excel file, so that the chart data can easily be updated without worrying about breaking the background image. The two strands of data are then stitched together with custom SQL so that we have a single data source in Tableau that contains all the data.

Starting Data for the view

The background

The sharp eyed among you may have noticed that the image above shows the underlying data containing far more radials than the resultant viz. This is to allow the radar chart to automatically grow to as many metrics are included in the data, up to a total of 20 radials. There are two parts to the background – the radials and the rings.

The Radials

These exist on the zeroth ring, and use the Spindle Point dimension to go from 0 (centre of the chart) to 1 (110% of the extent of the data). The number of radials depends on a count of the number of metrics that are present in the view at any one moment. This is done by using one table calculation to determine the number of metrics for each of the data dimensions, and then we wrap that in another to allow all elements of the viz to access this number

Number of Metrics

Once we know the number of radials we are plotting, we then need to know how to arrange them. Using the previously calculated number of radials, we can just divide that into 2PI to get the angle between each one. Note that Tableau works in Radians, so for those of you that are used to 360degrees, sorry!

Using this, we can now work out the X and Y co-ordinate of the points on the radial line using basic trigonometry:

X = length * SIN(angle)

Y = length * COS(angle)

A line is then drawn for each radial and we move on.

The Rings

Next step is add the rings to connect each radial. The last ring is at 100% of the maximum of each measure, and the rest of the rings are equally spaced between the maximum and the centre. The number of rings is determined by a parameter, which is currently surfaced on the viz. To make the calculations easier, the rings don’t need to know about what the maximum value is, as the length for the maximum is fixed at 1, so the length for each ring is just

(1/[Total Rings])*Ring

Using the same trigonometry calculations as before, we can get the X and Y co-ordinates that we join up for each ring.

The Data

Finally, we move on to the data. The idea is to map each metric onto the corresponding radial. To do this we need to number the metrics, but as we want to be able to filter the metrics on the fly, we need to make the numbering dynamic, after the filtering. This means table calculations, and in this case, we turn to the INDEX function.

If ISNULL(Min([Radial])) Then INDEX() End

Utilising similar steps as for the background, we use the metric number to work out the angle, the metric value vs the max value to work out the length, and then the angle and length to provide the X and Y coordinates.

These points are then used to create a polygon for each dimension.

Putting it all together

Using the combined X field and the background Y field, we start off by creating the background lines, and then dual axis this with the Y field for the metrics.

Things are looking good, but we need some additional tweaks to bring a bit more polish.

  • The metrics are added as a dimension filter
  • The dimensions are added as a table calculation filter. This is to allow dimensions to be selected without resetting the maximum value for each metric
  • Labels to indicate what the maximum for each metric is. This is a little tricky, with each background radial looking for the maximum for the corresponding metric, and what that metric is called

 

How to use this viz

As I mentioned earlier, this was designed to be easy to move into another workbook. The way to do this is to modify the underlying data.

  1. Download the twbx workbook from Tableau Public.
  2. Download the Radar Chart Data. Open the excel file. Do not touch the Radials or Rings tabs. Modify the data within the Data tab, without changing the structure, though you can alter the number of metrics for each dimension
  3. Save the excel
  4. Open the workbook. Try to refresh the extract. At this point it will ask you to provide the new file location. Just point it at your modified excel. The extract will be refreshed, and the dashboard will show your data on a radar chart.

 

I hope that was clear and that now if you are asked to produce a radar chart, you can have this sitting up your sleeve for an easy win. Of course, this again doesn’t cover the fact that a radar may not be the best way to visualise the data, but this was more about being able to easily make what you need to for your audience. And hopefully I succeeded in making it have the Tableau feel.

 

And there we go. Radar Charts done in Tableau. Let me know what you think.

24 thoughts on “Radar Charts in Tableau – Part 3

  1. Hi Andrew

    Thanks so much for your sharing. It’s much useful that I could apply it for my project with Tableau. But I am having a problem with label. When I change dimension (Car A, B, C) and refresh data, the label which maximum point of each metric is disappeared. How can I fix it? Can you advise? Thanks in advance.

  2. Hi Andrew

    I found out way to update my data for this chart. Maybe I am amateur at Tableau. My way is that taking out dimension in Y-background before re-connecting data, and then bring it back and delete old dimension in manual sorting.

    Again, Thank you so much.

  3. Hi Andrew,

    One more stuck when I am trying to add more metrics from your temple. Only there are 6 radials line for 6 metric. Can you advise me how I can fix it when I want more metrics from 6?

    Appreciate for your help.

  4. Cool visualization, slightly over my head on how it works exactly. I am having the same trouble as Trang i.e. refreshing it with my own custom data the labels disappear..

    any tips on how to fix that?

  5. wonderful workbook. I am facing the same problem though, impossible to get my labels showing up, Martin/Trang did you find the trick?
    thanks

  6. @ martin,
    You can get the labels to appear by just changing the order of the dimensions in the legend. You need to have the background dimension on the top to display the labels.
    Hope this helps!

    1. Hi Pranay,

      How does one do this? (change the order of the dimensions in the legend). I’m having the same issue as the others.

      Andrew – this is great stuff, thanks!

  7. If you wanted to use a line graph rather than polygons does anybody have a way of making the end of the line join back to the start? Any help would be appreciated. Love this though!

  8. Hi,

    thanks a lot for this! But I am not able to refresh the data with my own. Refresh is greyed out under Extract. What am I missing?

    Cheers
    Ewa

  9. Hi all, can anyone help me get the labels back on to this viz? Have tried playing around with the above but to no avail! Thanks for your help

    Simon

    1. Hi Simon – I think the bets approach would be to try post the twbx in the Tableau community, feel free to post a link to the post you create and one of us will try and look if you get no responses.

  10. Hi all, can anyone help me get the labels back on to this viz? Have tried playing around with the above but to no avail! Thanks for your help

    Simon

  11. Hi, as Feliks mentioned, this chart does not work correctly in Tableau 9.0, could you please provide an updated version?

  12. Hi Andrew,

    Thanks a lot for this useful information.i am trying to build a radar chart with six metrics.
    Could you please advise how to bring the background axes in the radar chart.In the above example only Cost axis is shown.I wanted to show all the background axis to be displayed to get a clear background hexagon.

    Please help

    Regards,

    Vishnu

  13. Hey Andrew- I backwards engineered your radar viz which worked (yay!) however, i would love for the lines of the radar diagram to be present in all 5 sides of my spider pentagon graph. Now, you can only see lines for top left 1/5th like in your picture. how can i do that?

Leave a Reply

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