OHCL Charts in Tableau
In this Tableau Quick Tip, we are going to create an Open-High-Low-Close (OHLC) chart in Tableau, we will do this within 5 mins or less.
Data
Let us start by loading the following data in Tableau Desktop / Tableau Public:
Note: this is SnapChart data as of the 22nd November 2019.
Calculated Fields
Create the following Calculated Fields:
Spread: Close-Open
SUM([Close])-SUM([Open])
Spread: Low-High
SUM([Low])-SUM([High])
I also require us to download and load two shapes into Tableau:
and that is it, let us now build our worksheet.
Worksheet
We will now create our worksheet:
- Change the Mark Type to Gantt.
- Drag the Date onto the Filter Shelf.
- Filter for the Last 3 Months.
- Set the Anchor relative to 24/11/2019.
- Drag Date onto the Columns Shelf.
- Right-click on this object and select Exact Date and then select Discrete.
- Drag Spread: Low-High onto the Size Mark.
You should now have the following:
We will now add our open and close icons:
- Drag Measure Values onto the Rows Shelf.
- Drag Measure Names onto the Filter Shelf and select Open and Close only.
- In the Measure Values Mark Panel. Change the Mark Type to Shape. Drag Measure Names onto the Shape Mark. Assign Close and Open to the appropriate Shape.
- Right-click on Measure Values and select Dual Axis. Right-click on the axis header and select Synchronise Axis. Double-click on the axis header and uncheck Include Zero.
- In the SUM(High) Marks Panel, reduce the size.
You should now have the following:
We will now adjust the cosmetics:
- Drag Spread: Open-Close onto the Colour Mark. Adjust the colour so that below 0 is red, above 0 is green.
- Hide the Axis Headers.
- Set Grid Lines to None.
- Set Row Dividers and Column Dividers to None.
- Adjust the Tooltips.
You should have the following:
and boom, we are done. We have created our Quadrant Plots in Tableau. You can find my data visualisation Tableau Public at HERE
Summary
I hope you all enjoyed this article as much as I enjoyed writing it. Do let me know if you experienced any issues recreating this Visualisation.