Rounded Bar Charts in Tableau

If you haven’t already heard about it, there is a new data viz community projects on the streets and it’s called Back to Viz Basics. The B2BV project is run by my good friend Eric Balash and you can find all the information on the project on the Tableau Student Guide website.

I decided to join in on the fun and complete a quick and simple (yet fun) bar chart for the first “teaser” data set, which was on Thanksgiving food, and since we just had our feast, I thought this would be fun. After I posted my viz, a few people asked about how I made my rounded bar chart. Now, this isn’t a new technique and you certainly can find other blogs that explain this, but why not provide simple tips for newbies just as the B2VB project is helping people learn the foundational skills in Tableau and data viz.

So without further ado, let me share both how to create the rounded bars and how I decided on my design.

The Design

I’m starting telling you about my design because this was the catalyst for actually deciding to use a rounded bar chart (which, by the way, is not really a best practice in the business world, but can add pizazz to personal projects). If you happened to watch my Zen Master tips in the 2021 Tableau Conference, I explain my process on “copying” and finding designs to replicate in an effort to learn and hone in on my own designs, or at least the designs I find pleasing. This build was no different.

I was poking around Pinterest for ideas when I came across this bar chart stock image.

Now, let me show you my final dashboard version. “What the heck!?”, you may say. “That looks identical!” Why, yes. Yes it does. That was the whole point. Could I replicate the design using the assigned data set in Tableau?

I chose to use Figma to create the background image which consists of the title, the background rounded bars with drop shadows, and the footer. However, I could have created all of this in Tableau with the exception of the drop shadows but I would have to sacrifice the inner rounded bar for the outer. Since I was going for a close to exact replication, I used Figma. I’ll show you in the next section how you could do the outer rounded bars in Tableau, however.

Rounded Bar Charts

Okay, now to the actual technical skill.

The trick here is that these “rounded bars” aren’t bars at all. In Tableau, I use the line mark type to create a “line” between two values – 0 and the value of the metric (Thanksgiving food, in this case). As you can see in the image below, we need to use Measure Values on rows (or columns depending on your use case). When you add Measure Values to rows, all the measure values will populate in a new “Measure Values” card in the lower left. Now, depending on your data set, you may have many pills listed on that card. Double click and type in MIN(0) directly into the Measure Values card and then remove everything except for this new pill and the value you want to show in your rounded bar chart.

Next, change the mark type to a line and add Measure Names to the Path card. This action will connect the two values (0 and your data value) via a line. Adjust the size (using the card that looks like two bubbles) to make the line thicker, resulting in a rounded bar appearance. One important thing to keep in mind is that the lower limit of the axis will need to extend below zero if you want both ends rounded because the line’s “circular edge” will extend below the zero line. If you want only a rounded end at the top of your bar then you could fix the lower axis to 0, which results in a flat bar at the start of the bar.

Now, if you want to use the outer rounded bar, you can first check out this viz I did which uses this technique (albeit a bit differently). To do this, type in MIN(1) in the Measure Values (this is because this particular example is a range of percents from 0-100%) and remove your data value (Percent) from Measure Values. Add your data value (Percent) to rows and make a dual axis. The data value should be a bar and this will be within the rounded outer bar now. Another way to do the two rounded bars would be two charts one floating on top of the other but I think this looks pretty good as well if you wanted basically the same effect without using an outside tool.

I hope that was helpful in learning how to make a rounded bar chart in Tableau.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s