Create Candlestick Chart in Tableau

As a data analyst, I was working with a dataset that recorded values at different points in a day. The data includes the opening value, the highest point, the lowest point, and the closing value. Over a three-month period, I wanted to visualize how these values changed and identify trends or fluctuations.

For this data visualization, we have a Candlestick chart in Tableau. It represents the range and movement of data within a specific time frame, making it easy to spot patterns and compare changes across different periods.

In this tutorial, I will explain the Tableau Candlestick chart and how to create one by analysing the market data.

What is a Candlestick Chart in Tableau?

In Tableau, a Candlestick bar chart is used to visualize the data for financial analysis, such as market data. Using the Candlestick chart, we can display the open, high, low, and close prices or other related data over a specific period.

In this chart, each candlestick(bar) represents one time interval, such as a day, week, or month. The Candlestick chart is created using the two components, Body and Wicks.

The Body is the thick part of the candle that shows the range between the opening and closing price. In this, blue candles show the closing price is higher than the opening price. The orange candles mean the closing price is lower than the opening price.

The Wicks or whiskers are the thin lines above and below the body, showing the highest and lowest prices reached during that time.

Create a Candlestick Chart in Tableau

To create a Candlestick chart, we will use the data from ProductPrices.csv. Using this data, we will create a Candlestick chart to visualize the high-low and fluctuations in the prices over time.

Connect the Tableau with the data source and follow the steps below to create a Candlestick chart in Tableau.

In this example, we will take the data of the last three months; for this, drag the Date field to Filters. In the filters, select Relative dates > Months > Last 3 months and click OK to apply filters.

Create a Candlestick chart in Tableau

Now add the Date from the Filter to the Column and the Open field to the Rows. After this, add Close to the detail card. On the chart, we can see the open and close prices for a specific date.

Tableau Candlestick chart

To display the closing price, navigate down the bar and create the formula field below.

//Change in Price
SUM([Close])-SUM([Open])

To show the increase and decrease in the bars, create a calculated field using the formula below.

// Increase
[Change in Price]>0

Add the calculated field Increase to the Color card in the Marks section. This will show the increasing(positive) values in blue and the decreasing (negative) values in orange on the chart.

Show high and low in Tableau candlestick chart

Now, to show the difference between the open and the close price, add the high field to the Rows. In the Marks section of the High axis, add the low field in the details card.

Create Tableau Candlestick Chart

Create another calculated field to make the bar go down for low prices on the High axis.

//Change from high to low
SUM([Low])-SUM([High])

Add the calculated field Change from high to low to the size cards in the Marks section of the High axis. After this, decrease the size of the bars to the thinnest to display them as threads on a candle (bars).

Candlestick Chart in Tableau

After this, click on the High in the Rows and select Dual axis. This will show the grey bars as threads on the bars (candles).

Dual axis in tableau candlestick chart

To synchronize both charts, click on the axis on the right side and select Synchronize Axis. After this, select Move marks to front to send the grey bars behind the color bars.

Synchronize tableau Candlestick Chart

For a better view, click on the Y-axis and select Edit Axis. In the Edit Axis, uncheck Include zero. This format will display the candlestick chart in full view.

Edit axis in Tableau Candlestick chart

After this, you can format the chart, such as changing the header label or hiding the header. To change the label, right-click on the axis > Edit Axis > Change Axis Title.

To hide the label, right-click on the axis and uncheck Show header.

Tableau Candlestick chart data

The final output of the Tableau Candlestick chart will look as shown in the image below. In this chart, we can analyse the daily price movement, including open, close, high, and low values displayed in the tooltip.

Tableau Candlestick bar chart

This way, we can create a Tableau Candlestick Chart to compare data such as market-related data and price fluctuations over time.

Conclusion

In this Tableau tutorial, we have learned about the Candlestick chart in Tableau and how to create one to visualize data such as market data.

In the above example, we have created a Candlestick chart that combines the open, close, high, and low prices into one view, with the body(candle) representing the price change and the wicks(threads) showing the range for the day.

You may also like to read:

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.

Salesforce flows complete guide

FREE SALESFORCE FLOW EBOOK

Learn how to work with flows in Salesforce with 5 different real time examples.