Video tutorial shows a new way to prepare the data using self Union.

A few days ago, one of our #MakeoverMonday Data Camp mates Jocelyn Ji created a viz based on radial bar chart. It looks interesting. So I dug into it and found the original approach is published by Toan Hoang. Tableau's product guru Bora Beran also created a similar chart a while ago.

I found that the calculation of the chart can be made a bit easier:
- all (nested) table calculations only need to compute along a single dimension.
- shorter bars need fewer data marks. Total data marks are reduced.

Here is my approach, based on the same data set as Hoang's, with an extra column Type. This table can be generated using Union or Cross Join from the original data.
 
Path is created from Type. The largest value will have 271 data marks. The smaller values will have less marks, in proportion to the Values. The previous solutions need a uniform number of data marks for each bar, no matter what the bar size is.

Path is defined as such where each bar has a different number of data marks. The largest has 271 marks. 271 is an artificial number. We may give a different one if we wish. The bigger the number, the smoother the curve.
  • CASE  [Type]
  • WHEN 1 THEN 0
  • WHEN 2 THEN [Value]*270/{MAX([Value])}
  • END
Format Path as Integer. Then Create a bin on Path with step size 1.

To trigger data densification by Path bin:
- Drag it to the Rows, right click it and select Show Missing Values
- Then drag it to the Path shelf of line chart data mark.
- Note in our example, at the bottom-left corner, the number of data marks is showing 731 from initial 10.

The calculated fields are created as follows:
- Pi = Window_Max(Max(Pi()))   //Pi for every data point.
- Rank = Rank_Unique(-Sum(Value))  //Reverse rank as radius.
- Rank Max = Window_Max(Rank)  //Rank available at every data point.

Coordinates are calculated as follows, the same as those of a circle:
- XCOS((Index()-1)*[Pi]/180)*[Rank Max]
- Y = SIN((Index()-1)*[Pi]/180)*[Rank Max]

The first 3 calculated fields are nested within X and Y. We need to edit the table calculations of X and Y to set up those for each of the nested fields.
Among the 5 calculated fields, 4 are computed along Path bin. The exception is, Rank is computed along Name. Select each of the nested dimensions and set it properly.

The labels are placed at the start of the lines using the appropriate option, with matching colors.

Voila, we got the viz as follows. You can view/download the interactive viz by clicking the picture below.
https://public.tableau.com/views/RadialBarChart_1/Dashboard1?:embed=y&:display_count=yes
Filtering the Chart
If you have extra data columns in your original data and need to add filters, set the filters to be context ones. This way, they act before the LOD calculations in Path.
14

View comments

  1. Hello, I was able to create the first ring, but as soon as I add the category to the color shelf, the legend showed the different categories, but I can still just see one ring. Can you please tell me what could be the reason for that? Thanks, Varun.

    ReplyDelete
    Replies
    1. Likely it's because of table calculations. There are 5 of them. 4 of them should calculate along Path Bin. Rank must calculate along Name/Category.

      Delete
    2. I have the same issue as Varun... One circle despite Rank of both X and Y being calculated on "Name" and the others on "Path (bins)".

      Delete
    3. Leanne, you can send me your workbook alexandermou2000 at gmail. will have a look.

      Delete
    4. hi. im having the same issue. only one circle

      Delete
  2. is it possible to do this w/percentage values? for example, each as a percentage to goal. and also, to limit to a half circle rather than a full

    ReplyDelete
    Replies
    1. It’s possible. It’s a matter of scale. Divide all percentages by 2 will limit bars in half circle.

      Delete
  3. Hi, I couldn't rank the dimensions properly, meaning the the rings are overlapping if the values are too close, any thoughts?

    thanks
    Srikanth

    ReplyDelete
    Replies
    1. 1.you rank the measure per dimension element.
      2.use Rank_Unique() so that there is no overlapping even if they are the same measure value.

      Delete
  4. Made a video tutorial. See if it helps.

    ReplyDelete
  5. Sir, can I create the chart without copying the data set ?
    My data set is huge in volume ?

    ReplyDelete
    Replies
    1. You can connect to the database and create union in SQL. I replied you under the youtube channel.

      Delete
  6. Hi Alexander, I have been struggling to create a radial bar chart and have been using your video tutorial. I even simplified my data to recreate bar chart with different numbers. I could really use your help!

    ReplyDelete
    Replies
    1. Sure. Connect with me on Linkedin https://www.linkedin.com/in/alexmou/

      Delete
Blog Archive
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.