How to Add Border to Bar Chart in Tableau
Adding a simple border to a bar chart in Tableau can instantly make your visualization look more polished and easier to read. It's a small tweak that adds a professional touch by creating clear visual separation between bars, especially when colors are similar or the background is busy. This guide will walk you through the standard method for adding borders and introduce an advanced technique for greater customization.
Why Bother Adding Borders to Your Bar Charts?
Before jumping into the "how," it's helpful to understand the "why." A well-placed border isn't just for looks, it serves a practical purpose in data visualization.
- Improved Readability: Borders create a distinct outline for each bar, making it easier for the eye to distinguish between them. This is particularly useful in charts with many bars packed closely together.
- Enhanced Separation: When using a color palette with subtle variations or shades of the same color, bars can blend together. A thin, dark border solves this by providing a clean separating line.
- Aesthetic Polish: A crisp border gives your chart a finished, professional appearance. It shows attention to detail and can help your dashboards look more cohesive, especially when matched with an overall design theme.
- Highlighting Data: With a bit of customization, borders can also be used to draw attention to specific bars that meet a certain condition, though this is a more advanced application.
The Easiest Method: Using the Color Mark
Tableau makes adding a basic border incredibly straightforward. This is the go-to method for 95% of use cases and takes only a few seconds. We'll use the Sample - Superstore dataset that comes with Tableau so you can follow along.
Let's start by building a simple bar chart showing Sales by Sub-Category.
- Drag the Sub-Category dimension to the Columns shelf.
- Drag the Sales measure to the Rows shelf.
- Sort the chart in descending order for better readability by clicking the sort icon on the Sales axis.
You should now have a standard vertical bar chart. To add the border:
Step 1: Open the Color Menu On the Marks card to the left of your worksheet view, you'll see several properties like Color, Size, Label, Detail, and Tooltip. Click on the Color button.
Step 2: Select the Border After clicking Color, a small menu with several options will pop up. At the bottom, you'll see a dropdown menu labeled Border. It's likely set to "Automatic" or "None" by default.
Step 3: Choose a Border Color Click on the Border dropdown. A color palette will appear. You can now select the color you want for your bar chart borders. A dark gray or black is usually a safe choice for good contrast, but you can choose any color that fits your dashboard's theme. That's it! As soon as you select a color, you'll see borders appear around each bar in your chart. This method is quick, easy, and effective for most situations.
Pro Tip: Adjusting Border Effects
Within the same Color menu, you'll also see a slider for Opacity and an Effects dropdown. The opacity slider affects the fill color of the bars themselves, not the border. The Effects options are more relevant to map marks, so for standard bar charts, the main customization here is simply picking a border color.
Advanced Technique: The Dual Axis Method for Thicker Borders
The standard method is great, but what if you need a thicker, more prominent border? The default border is a fixed, one-pixel line, and Tableau doesn't offer a direct way to change its thickness. For full control, we can use a slightly more involved technique involving a dual axis chart.
This method works by essentially creating a slightly larger 'background' bar behind your main bar, giving the appearance of a thick border. It sounds complex, but once you do it a few times, it becomes second nature.
Let's start with the same Sales by Sub-Category chart.
Step 1: Duplicate Your Measure Hold down the Ctrl key (or Cmd on a Mac) and click and drag the SUM(Sales) pill that's already on your Rows shelf. Drag the copy right next to the original one on the same shelf. This will create an identical, second bar chart directly below your first one.
Step 2: Change the Second Mark Type On the Marks card, you will now see tabs for each of your SUM(Sales) measures. Click on the tab for the second (bottom) SUM(Sales) pill. The mark type is currently set to "Bar" (or "Automatic"). Click the dropdown and change it to Bar. This makes your bottom chart have thinner bars. For the sake of clarity, let's rename the top pill as Bar Chart Foreground and bottom pill as Bar Chart Border.
Step 3: Create the Dual Axis Right-click the second SUM(Sales) pill (Bar Chart Border) on the Rows shelf and select Dual Axis from the context menu. Your two charts will now be layered on top of each other. It may look a bit messy at this stage, but we're almost there.
Step 4: Synchronize the Axes This is a crucial step! The two charts now share one view but have separate axes. We need them to be on the same scale. Right-click on either of the vertical axes (e.g., the right one) and select Synchronize Axis. Now both layers of your chart are perfectly aligned.
Step 5: Adjust the Layering and Sizes This is where the magic happens. We need to make the background bar slightly larger than the foreground bar.
- On the Marks card, select the Bar Chart Background (your Gantt Bar instance). This will be our border. Click on Color and choose the color you want your border to be (e.g., dark gray). Then, click on Size and move the slider to the right to make it a bit thicker.
- Now, on the Marks card, select the Bar Chart Foreground (your original bar instance). This is the colored bar. Click on Size and move the slider slightly to the left, making it a bit thinner than the "border" layer behind it.
You may need to adjust the sizes of both layers until you get the perfect border thickness you're looking for. The thinner the foreground bar is relative to the background bar, the thicker a border it gives off in appearance.
Step 6: Final Cleanup To finish, you can remove the unnecessary axis header on the right. Right-click on the right-side axis and uncheck Show Header.
Best Practices for Bar Chart Borders
Now that you know how to add them, here are a few tips to use them effectively:
- Use Consistent Contrasting Colors: Don't make your borders distracting. A neutral dark gray or black is often a better choice than a bright, competing color. The goal is to separate, not to clash. If you do use color, try to match it to a secondary color from your brand palette.
- Keep it Subtle: Often, the best visualizations are clean and unobtrusive. Unless your specific goal is to create a highly stylized chart, a thin border is all you need to provide a clean separation.
- Be Mindful of Stacked Bars: When you add borders to a stacked bar chart using the simple method, Tableau adds a border around every single segment of the bar. This is a great way to delineate the different parts of the stack, but if your segments are very small, the chart can quickly become cluttered with lines.
Final Thoughts
Adding borders to bar charts in Tableau is a simple skill that can significantly elevate the professionalism and readability of your dashboards. Whether you use the quick single-click method for basic clarity or the dual-axis technique for customized thickness, it’s a design element that adds a lot of value for very little effort.
While mastering small details like this is part of becoming proficient with tools like Tableau, the entire process of building reports - connecting data, creating charts, and fine-tuning them - can be a huge time sink. At Graphed, we've automated this process so you can get from raw data to beautiful, real-time dashboards without the manual busywork. You can create the same professional charts you build by just describing what you need using plain English, allowing you to ask questions and get insights in seconds, not hours. If you're tired of wrangling charts and just want answers, give Graphed a try and let our AI analyst do the heavy lifting for you.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?