Tutorials › Tableau › Bar Charts in Tableau

Bar Charts in Tableau

Build vertical and horizontal bar charts, sort bars, add labels and colour, and use bar charts to compare the EVIKA dataset by category, product, and city

The bar chart is the most useful chart in data analytics. It is not the most glamorous, but it is the one you will use in 60–70% of your dashboards — because it communicates comparison clearly, works for any audience, and is fast to read.

Tableau makes bar charts exceptionally easy to build: drag a Dimension to Columns, drag a Measure to Rows, and a bar chart appears. The interesting part is what you do next — sorting, colouring, labelling, stacking, and choosing between vertical and horizontal orientations for different data shapes.

One rule that separates analysts who make good charts from those who make bad ones: sort your bars. An unsorted bar chart forces the reader to search for the highest and lowest values. A sorted bar chart communicates the ranking instantly. In Tableau, sorting takes two seconds and makes every bar chart significantly more useful.

By the end of this chapter you will know how to build any bar chart a manager or client might ask for — simple comparison, stacked, side-by-side, horizontal — with professional formatting.

What you will learn
  • How to build a vertical and horizontal bar chart in Tableau
  • How to sort bars, add colour, and add labels
  • How to build stacked and side-by-side bar charts
  • When to use each bar chart type for different comparison questions

Ch 6 Ex 1 — Revenue by category (basic vertical bar)

Goal: show which product category generates the most revenue

Step 1: Open a new worksheet
Step 2: Drag Category (Dimension) → Columns shelf
Step 3: Drag Total Amount (Measure) → Rows shelf
        → Tableau auto-creates a vertical bar chart

Step 4: Sort descending:
        Click the Sort Descending icon in the toolbar
        (or right-click the axis → Sort → Descending)

Result:
Category      | SUM(Total Amount)
─────────────────────────────────
Furniture     | ₹11,397
Electronics   | ₹4,186
Stationery    | ₹985 (approx, based on EVIKA orders)

Step 5: Right-click any bar → Mark Label → Always Show
        → Revenue values appear on top of each bar
💡 Always sort bar charts. An unsorted bar chart makes the reader work harder than necessary. Sorted descending is the standard for comparison charts.

Ch 6 Ex 2 — Horizontal bar chart (many categories)

Horizontal bars work better when:
  → You have many categories (labels are long)
  → Category names overlap in a vertical chart

How to flip from vertical to horizontal:
  Method 1: Click the Swap Rows/Cols button in toolbar
  Method 2: Drag Category to Rows, Total Amount to Columns

Result: horizontal bar chart
  Ergonomic Chair  ████████████████████  ₹8,999
  USB-C Hub        ████                   ₹1,499
  Desk Lamp        ███                    ₹1,199
  Wireless Mouse   ██                     ₹899
  Notebook A5      █                      ₹495
  Ballpoint Pens   █                      ₹490
  HDMI Cable       ▌                      ₹299

Product name labels are readable — no rotation needed.
💡 Use horizontal bars when product names or category names are long. Rotated labels (angled text) are hard to read and should be avoided.

Ch 6 Ex 3 — Colour bars by category

Add colour encoding to highlight categories:

Step 1: Build the Revenue by Product chart (Ex 2)
Step 2: Drag Category (Dimension) → Marks > Color

Result: each bar is coloured by its category:
  Ergonomic Chair  ██ (Furniture — blue)
  USB-C Hub        ██ (Electronics — orange)
  Desk Lamp        ██ (Furniture — blue)
  Wireless Mouse   ██ (Electronics — orange)
  ...

Customise colours:
  Click the Color legend → Edit Colors
  → assign specific colours to each category
  → Tableau's default palette is accessible (colour-blind safe)

Add a colour legend title:
  Right-click the legend → Edit Title → type "Category"
💡 Colour by Category also adds a legend automatically. If your dashboard has a single category with one colour, the legend is redundant — right-click and hide it.

Ch 6 Ex 4 — Stacked bar chart (revenue by city, stacked by category)

Goal: show each city's revenue AND which category drives it

Step 1: Columns: City
Step 2: Rows: SUM(Total Amount)
Step 3: Marks > Color: Category
        → Tableau stacks segments by category automatically

Result:
City        | Stacked bar (each segment = category)
────────────────────────────────────────────────────
Mumbai      | ████████████████ (Furniture — Ergonomic Chair)
Noida       | ████████ (mix of Electronics + Stationery)
Delhi       | ████ (Electronics)
Bengaluru   | ▌ (Electronics)
Pune        | (no orders)

Step 4: Add labels to segments:
  Marks > Label → drag SUM(Total Amount) onto Label
  Label → "Selected" → check "Min/Max" to avoid clutter
💡 Stacked bars show composition (what makes up each total) but make it hard to compare individual segments. Use side-by-side bars (next example) when comparing segments is more important than showing totals.

Ch 6 Ex 5 — Side-by-side bar chart

Goal: compare category revenue within each city side by side

Step 1: Columns: City, Category (drag Category after City)
Step 2: Rows: SUM(Total Amount)
Step 3: Marks > Color: Category (optional — adds colour)

Result: within each city, one bar per category appears side by side:

Noida:   Electronics ██  Furniture ████  Stationery █
Mumbai:  Furniture ████████████████
Delhi:   Electronics ████

This makes it easy to compare categories WITHIN a city
and ACROSS cities at the same time.

Tip: add a reference line for the overall average:
  Right-click the Y axis → Add Reference Line
  → Value: Average (SUM(Total Amount))
  → Label: "Average ₹2,154"
💡 Side-by-side works best with 2–4 categories. More than 4 categories makes the chart too cluttered — use a filter or a different chart type.

When to use each bar chart type

Chart typeUse whenAvoid when
Vertical barComparing 3–8 categories with short namesLabels overlap or names are long
Horizontal barMany categories or long category namesYou have fewer than 4 categories
Stacked barShowing composition (what makes up each total)Comparing individual segments is the goal
Side-by-side barComparing sub-categories within each groupMore than 4 sub-categories per group
100% stacked barShowing percentage share, not absolute valuesAbsolute totals matter to the audience

Key Points

  • ✓Always sort bars — sorted descending is the default for comparison charts
  • ✓Horizontal bars are better than vertical when category names are long
  • ✓Drag a Dimension to Marks > Color to add colour encoding and a legend
  • ✓Stacked bars show totals and composition; side-by-side bars enable segment comparison
  • ✓Add labels (Marks > Label) so readers do not have to guess exact values from the axis

Tips

💡 Sort every bar chart unless there is a natural order (e.g. months of the year — do not sort those alphabetically).
💡 Show the axis OR labels — not both. If you have labels on the bars, the axis is redundant. Right-click the axis → Uncheck "Show Header" to hide it.
💡 Start your bar axis at zero. Truncating the axis (starting at a non-zero value) makes small differences look large and misleads readers.
💡 For currency values, format the axis: right-click the axis → Format → Numbers → Currency → ₹ with 0 decimal places.

FAQ

How do I change bar colours without colouring by a field?
Click the Color button on the Marks card (without dragging a field to it) → click the colour swatch → choose a colour. This applies one colour to all bars. Use this when colour-coding by category would be distracting and you just want a clean chart.
My bars are very thin — how do I make them wider?
Click the Size button on the Marks card → drag the slider right to increase bar width. Alternatively, right-click the view → Format → Column Width.
How do I add a target line or average line to a bar chart?
Right-click the Y axis → Add Reference Line → choose Average, Constant, or use a parameter for a dynamic target. The reference line runs horizontally across the chart, making it easy to see which bars are above or below the target.
Practice Question

You have 12 product names, each with a long descriptive name, and you want to compare their revenue. Which bar chart orientation should you use?

Vertical bars — standard for comparison
✅ Horizontal bars — labels are readable without rotation
Stacked bars — shows composition
Pie chart — shows proportion
Explanation: Horizontal bars are the right choice when category names are long. In a vertical chart, 12 long product names would need to be rotated or truncated to fit. In a horizontal chart, names appear on the Y axis with full readability.
← The Data Source Page in DepthLine Charts & Time-Series Analysis →
Want live Tableau training?
EVIKA Academy, Noida Sector 51 — hands-on projects, job-ready curriculum
Book a Free Demo →