Visualization

Creating Coxcomb Charts in Tableau

Nightingale’s rose is probably one of the most influential visualizations of all time as the tool Florence Nightingale used to convince Queen Victoria about improving hygiene at military hospitals hence saving lives of many thousands of soldiers.

Commonly referred to as coxcomb or polar area charts, roses resemble both pie and bar charts in some respects. The layout resembles a pie chart but each slice has the same angle in coxcombs unlike pies. While radius of the slice is related to quantity being displayed (like height of the bar in bar charts), coxcomb uses the areas of slices.

Coxcombs help make seasonal patterns visible and deemphasize small differences while providing a nicer image, all of which worked well for Nightingale’s use case given her data and the target audience for the charts.  This may or may not apply to every situation so often a bar chart is probably the safer route to go.

I was curious whether anyone had built a coxcomb chart with Tableau before but I didn’t come across any so I decided to make one myself. Following chart shows monthly sales for different departments. You can click on the image to bring up the interactive Tableau Public viz and also download to take a closer look on how it is set up.

Nightingale's rose in Tableau

Since each of the slices represent sales for that particular month and department, you will notice that the entire slice gets highlighted when you make a selection instead of just the band visible in the chart as you’d expect.

Nightingale's rose in Tableau

Each slice is a polygon comprised of 102 points (seemed to give a good, smooth curve) which are not present in the data but generated by taking advantage of densification in Tableau. Enjoy!

Standard

46 thoughts on “Creating Coxcomb Charts in Tableau

  1. Arup Kumar Das says:

    Thats great, can you guide me doing that. I was trying to do in STATA but did not found solution- while googling come across your page. I have recently got Tablue apps

  2. Pingback: Curved Lines in Tableau through Data Densification | Alan@Tableau

  3. Aquib says:

    I would love to have a walk-through of how you created this graph. Was there a specific chart type you modified to get here?

    • It uses the polygon mark type and draws the slices as custom shapes. It is not using any of the charts on ShowMe or Pie Chart as a starting point if that’s what you mean by specific chart type.

  4. Dylan Cross says:

    Great chart. I saw one of these a while back and wanted to make one myself, so this is a great help. I did find the areas kind of misleading though. I read it originally like a stacked bar chart, supposing office supplies generally had greater sales than furniture, which is certainly not the case.

    • This is more like a radial bar chart. It is possible but any reason why you wouldn’t do this using a regular bar chart. Bar chart would give you more accuracy and readability. Having in circular layout doesn’t gain you anything in this case. In my example, there is seasonality and radial layout puts items in right sequence. January is between December and February etc.

  5. Shrey says:

    Great chart!

    I was trying to recreate this, seeing your sheet, but I see a blank sheet. Also, I noticed that if we remove ‘X’ from Columns or ‘Y’ from rows and then put it back, the graph disappears.

    Can you kindly guide me through the steps so that I can identify if I missed any key step?

    • Most likely the issue is that addressing/partitioning settings are not the same. Best option would be to open the original workbook in a separate Tableau instance as you go through the process so you can look at settings for a calculation and replicate them in your workbook.

      You can access these settings through “Edit Table Calculation…” option in the pill context menu. Some of these are nested table calculations so you will see a drop down at the top of table calc settings dialog that will allow you to adjust settings for each underlying calculation as well.

      Here are some tutorials to get started on table calcs
      http://drawingwithnumbers.artisart.org/want-to-learn-table-calculations/

  6. Marc says:

    I cannot reproduce it… it seems that I can’t show “missing values” when choosing Polygon mark type… so it shows just one dot at the center. (0,0), because I have only two values: 0 and 102.

    Iif I try to show values with a table, it goes ok, but not when trying to show it as a Plygon… what am I doing wrong?

    Thanks a lot…

      • It looks like replication isn’t happening. Did you try dragging the binned field into row or column shelf, selecting “show missing values” from the pill’s context menu then dragging it back to its previous place?

  7. Marc says:

    I’ve made it! If you drag and drop from the pill’s context with the “shift” button pressed, it doesn’t work! you have to be careful with all of this… thanks a lot!

  8. Hussain says:

    First of all awesome visualization….just wanted to request you to also add a write-up for this visualization as there are a lot of calculated fields so that we can understand basically the logic behind having these fields

  9. Hussain says:

    I modified the workbook that you used for my scenario. However in my case even though I have 10 Category I only see 3 of them on the CoxComb chart. Is there anything else that I need to modify

  10. Pingback: Radial treemaps & bar charts in Tableau « Bora Beran

    • Calculation estimates a curve using 103 points. It could be any number. If it was 500, you’d get a smoother curve if it was 10, you would start seeing line segments. I thought ~100 was smooth enough.

  11. Manaswi Mishra says:

    Cant you make a youtube video of this? When I load this file of yours it works perfectly fine but when I try to replicate it, it goes blank. Please be kind enough to make a video of this so that others can learn and understand why. Otherwise it is just like copying and not understanding anything.Thanks

  12. Ottame says:

    Awesome chart! But I still have a doubt: where does the dimensions “Path” and “Path (bin)” come from? Are they calculated fields? Thanks

    • Path is a data source field, comes from Custom SQL. Path(bin) is a bin field created in Tableau using Path. Right click on Path, Create > Bins. Set bin size to 1. You should get the same effect.

      • Brian says:

        Bora – Is there an easy way to get the Path data source field into your custom sql statement. It looks like it duplicates the # of rows in your column and given i am working with 100k+ rows worth of data I am hoping there is an easy way to do this. Any thoughts here?

      • I would suggest aggregating data first to the level of detail that will give you as many rows as number of slices you would like to have in the end which should only be a handful. Then doubling the rows wouldn’t be an issue. This should be an easy change in SQL statement.

      • 1 and 102 are not really special. I picked those to be able to draw smooth curve. 200 would give you a smoother curve, 10 would give you coarser…

        1 and 102 are values added as part of the two select statements being UNIONed in custom SQL. The range between 1 and 102 is filled via densification in Tableau.

  13. Saumyajyoti Das says:

    Hi Bora,

    First of all, kudos to your idea of recreating a coxcomb chart in tableau. It’s simply mindblowing!

    I downloaded your file, replaced the data source and have been able to run my underlying data using your dashboard. But when I tried building the dashboard from the scratch, I was unable to recreate the same view. Needless to mention I have taken care of the exact addressing/ partitioning factors.

    As of now, I have tried the following:

    I pulled in the Product Category, followed by Month of Date to the color, Path(bin) to the Path and Avg(Sales) to the Details. I followed it up with the following two manners:

    1. Pulled each of the table calculations to the rows and columns and set the partitioning/addressing fields, and that too as per the sequence in which it appears when you over the X and Y. Then placed X and Y and changed all the addressing/partitioning views for those as well. Then retained only X and Y

    2. Changed the partitioning/addressing fields in the calculated fields directly. And then pulled X and Y respectively to the rows and column fields

    Point to be noted is in both the cases I was not able to obtain the sequence in which the fields are set when you hover over X and Y. I don’t know whether or not it’s important.

    It’d be very kind of you if you can help me figure out the sequence in which the dashboard is to be built. I know you might be very busy for a detailed explanation (which would have been really really great), but any lead/hint to how to recreate it on my own would be highly appreciated.

    Thanx in advance!

    • My first guess would be Path(bin). Bins have an option “show missing values” and it is how I generate the extra rows to hold the x-y coordinates that draw the curves. I would drag the bin object to row or column shelf and verify that the option is checked and if not, check it.

  14. Saumyajyoti Das says:

    Steps:

    1. Dragged Path(bin) to Columns, Show missing values Option checked
    2. Dragged Region(Equivalent to product Category) to Color, followed by Month of Date
    3. Dragged the AvgRespondentsToolTip(equivalent to AvgSalesToolTip) to Text
    4. Dragged X and Y respectively and set all the Addressing / Partitioning Values accordingly

    I’m still not able to get the view. I’m attaching the .twbx file. If possible, can you please spare a few minutes and look into the same?

    https://www.mediafire.com/?a6z28ybdrthd8e4

    Thanx in advance!

  15. chandra says:

    Hi. Thanks a lot for sharing such a wonderful chart. I am trying to copy the calculations to recreate the same but got stuck with ‘Path’.I am using superstore data store.Kindly let me know how to create this Path Column.Thanks.

  16. shaunak says:

    Hi Bora, This is shaunak.your expertise in visual tableau designs .could you create the radial and coxcomb chart using superstore data.Does these charts are used representing KPI’s. Would like to see more designs from you. As we see in Idashboards.

  17. alone777 says:

    Hello everyone. The trick in solving this comes through the courtesy of Simon Runic (http://tabsoft.co/1RYw2Ux)

    Pills will be affected by any and all other metrics/measures/dimensions that composed its aggregated calculation, and that one needs to properly partition each subset calculated field for each pill.

    In other words, when you drop the X and Y pill, and go to edit calculation, you then go through each field under the “Calculated field portion” and ensure the following conditions are true:

    X and Y Compute Using Path (bin)
    index Compute Using Path (bin)
    Angle Compute Using Date at the level Month of Date (restart: none)
    Edges Compute Using Date at the level Month of Date (restart: none)
    No of slices – Advanced: Partition(Product Category) Addressed(Month of Date, Path(bin) (At level: Deepest/Restart: None)
    Count Compute Using Date at level Month of Date (restart: none)

    Best of luck.

  18. Nikhil says:

    Great Chart! Would you be able to share the Custom SQL Query for creating the Path field in the data source? Thanks

  19. Hi Bora,

    https://drive.google.com/file/d/0B4YZRhClkRALMGRfOGFua29FN2c/view?usp=sharing

    This is the link to a windrose chart that I have attempted. I have also inserted a photo of a windrose in the tableau file for reference. Basically it represents the total frequency of wind in a given direction through radius and classification into speed groups through colour bands, both at the same time.

    The problem I’m facing here is that I need the different speed bands to be placed above the previous band in the pie. But as soon as I create wind speed groups and add in the marks, all the groups start from origin which is not what I want. Is there a way in which I can have them appear stacked as in the attached photo?

    Thank You!

  20. Pingback: Quick Tip : Overlaying curves on Tableau scatter plots with R « Bora Beran

    • Tamanna Hossain-Kay says:

      Figured it out – just a typo. In the duplicated rows I had Path = 120 instead of 102. Even though I’d dissected the Tableau viz a thousand times, hadn’t looked for typos on the SQL side. Thanks !

  21. HI Bora,

    Its a very nice chart, I have downloaded the workbook and try to compute the same as you did, But its showing a black sheet.. I tried all possible scenarios that is suggest above but it is still the same blank sheet. Please suggest something.

    Thanks
    Rohan

  22. Pingback: Coxcomb charts in Alteryx and Tableau: your one-stop blog shop. - The Data School

  23. Pingback: How To: Coxcomb Charts in Tableau – Down for the Count

  24. Pingback: How to Make a Clock Chart in Tableau | DataRemixed

  25. Sanjay Senthilkumar says:

    Hi, This was very impressive however would you be able to change the width size of each month based on a dimension? Let’s say the number of days or total sales or target

    Thanks

  26. Pingback: Why You Should Close the Computer for Your Next Data Visualization - WebSystemer.no

  27. Richa says:

    Hi,
    Thanks for sharing this amazing work.Is it possible to make this chart with same measurement of angles? I have a requirement to create a similar chart with increasing radius but same angles. What change should I do in the current calculations?
    Thanks,
    Richa

  28. Pingback: A is for ARTIST – #Coffeetableviz

Leave a comment