­­In this tutorial we are going to build a Circular Bar Chart. Data can be visualised in many different ways and this might not be the best way to represent the data for some business, so use caution while using such charts. I would like to take this opportunity to share how we can stretch our boundaries with Tableau and  build circular bar chart . I hope you will enjoy this quick and simple tutorial.

Data

** I have used Sample – Superstore data set to demonstrate radial bar chart. I will be using radial bar chart to show quantity of orders placed each day. For each bar we need four coordinated which will represent one row/ date. In order to achieve this i will be doing the union of order table 3 time to get four coordinates for each day.  Lets create following Calculated fields and parameters after connecting to Sample- Superstore data source:

Parameters

Lets create below list of parameters first:

@Innerradius: 3 as an integer value. This will give user an option to adjust the inner radius based on their requirement.

@White Space

To add white space between bars

@Full Angle To Use

By using this parameter user can choose an angle for their visualisation.

@Angle Adjustment

Create a parameter with data type float. With this parameter, we can dynamically rotate the chart at a particular angle.

Calculations

@Angle  in Degree

This is use to plot a point at an angle. We can adjust the value dynamically by selecting the Angle selection parameter.

IF  MIN([Table Name]) = ‘Orders’ OR  MIN([Table Name]) = ‘Orders1’ 

THEN ((AVG([@Angle Increment])*[@Index]) + [@Angle Adjustment]) 

ELSE ((AVG([@Angle Increment])*[@Index]) + [@Angle Adjustment] + AVG([@Angle Increment])*[@White Space])

END

@Angle in Radians

RADIANS([@Angle in Degrees])

@Angle Increment

[@Full Angle To Use] / { FIXED : COUNTD([Order Date])}

This calculated field is used to calculate an angle at which each bar is placed. It is based on the value that user decides for ‘full angle to use’.

@Index

@Orders Quantity

{ FIXED [Order Date]:countd([Order ID])}

This field is used to calculate the numbers of orders placed on a particular day.

@Path

This field is used to define the part of each bar based on its coordinates

CASE [Table Name]

    WHEN ‘Orders1’ THEN 1

    WHEN ‘Orders’  THEN 2

    WHEN ‘Orders2’ THEN 3

    WHEN ‘Orders$’ THEN 4

END

@Radius

This field defines the radius of the circle based on the value of inner radius entered by user in the parameter.

IF      [Table Name] = ‘Orders’ OR

        [Table Name] = ‘Orders2’

            THEN [@Inner Radius]

ELSEIF  [Table Name] = ‘Orders1’ OR

        [Table Name] = ‘Orders$’

        THEN [@Inner Radius] + [@Orders Quantity]

ELSE    [@Inner Radius] + 500

END

@Radius_Background

This field is used to define the radius value of the background effect of each bar.

IF      [Table Name] = ‘Orders’ OR

        [Table Name] = ‘Orders2’

            THEN [@Inner Radius]

ELSEIF  [Table Name] = ‘Orders1’ OR

        [Table Name] = ‘Orders$’

        THEN [@Inner Radius] + 16

ELSE    [@Inner Radius] + 500

END

@X

COS([@Angle in Radians])*AVG([@Radius])

Calculates X coordinates

@X_Background

COS([@Angle in Radians])*AVG([@Radius Background])

Calculates X Coordinates for background bar

@Y

SIN([@Angle in Radians])*AVG([@Radius])

Calculate Y Coordinates

@Y_Background

SIN([@Angle in Radians])*AVG([@Radius Background])

Calculate Y coordinates for background bars

Worksheet

We will now look into building our first worksheet

  • Change the Mark Typeto Polygon.
  • Drag X coordinate into Column Shelf
  • Drag Y coordinate into Row Shelf
  • Drag Day(Order Date) Calculated Field to details
  • Drag Table Name Field to details
  • Drag @Path to path
  • Drag Sum(@Order Quantity) to Toot tips
  • Hide the axis headers, grid lines, Zero lines

It will look something like below. Also, with the parameter on you can adjust the Angle, white space, inner radius and full angle to use.

  • Duplicate the sheet and replace X and Y Cordinates with X_Background and Y_Background and adjust the colours. This will create a background effect for each bar

The sheet will look something like below

Now we will adjust the Cosmetics and bring both these sheets to the dashboard:

  • Hide the Headers.
  • Hide the Grid Lines.
  • Hide the Zero Lines.
  • Adjust the Size.
  • Adjust the Tooltip.
  • Adjust the Colour.

You will want to end up with something like the following:

I hope you enjoyed this tutorial, and you can find this data visualisation on Tableau Public by clicking on the image or by clicking  here