Tableau Lesson 21 – Bar & Line Charts | Dataplexa
Section III — Lesson 21

Bar and Line Charts

Bar charts compare values across categories. Line charts show change over time. Together they cover the majority of business reporting needs — and mastering both in Tableau means controlling every visual detail from axis range to label position.

Bar Charts — The Right Tool for Comparisons

A bar chart encodes a Measure as the length of a rectangle. The longer the bar, the larger the value. This makes relative size instantly readable — the human eye compares bar lengths far more accurately than it compares angles (pie charts) or areas (bubble charts). Use a bar chart whenever your goal is to rank or compare values across a set of categories.

1
Drag Sub-Category to the Rows shelf. Drag Sales to the Columns shelf. Tableau builds a horizontal bar chart — Sub-Category on the vertical axis, SUM(Sales) on the horizontal axis.
2
Click the Sort Descending toolbar button to order bars from largest to smallest. The highest-selling Sub-Category moves to the top — making the ranking immediately obvious.
3
Drag Sales to the Label channel on the Marks card. Click the Label channel and set alignment to Right. Each bar now shows its exact value at the end — useful when precise numbers matter alongside the visual comparison.
4
Drag Category to the Color channel on the Marks card. The three Categories — Furniture, Technology, Office Supplies — are now colour-coded across the Sub-Category bars, adding a second layer of information to the same chart.

Bar Chart — Labelled Mockup

SUM(Sales) by Sub-Category — sorted descending, coloured by Category
Phones
$330K
Chairs
$328K
Storage
$223K
Tables
$206K
Binders
$203K
Copiers
$149K
Technology
Furniture
Office Supplies

Axis Controls — Range, Title, and Gridlines

Double-clicking any axis opens the Edit Axis dialog. Here you can set a fixed range (useful when comparing charts with different scales), change the axis title, reverse the direction, or add a logarithmic scale. Right-clicking the axis gives additional options including Format (font, line style) and Add Reference Line. To remove gridlines, go to Format → Lines and set Grid Lines to None.

Line Charts — The Right Tool for Trends Over Time

A line chart connects data points with a line to show how a Measure changes over a continuous sequence — almost always time. The slope of the line encodes the rate of change: a steep upward slope means rapid growth, a flat line means no change, a downward slope means decline. Use a line chart whenever the sequence or direction of change is the story you want to tell.

1
Drag Order Date to the Columns shelf. Tableau defaults to the YEAR level of the date hierarchy — a blue discrete pill. Right-click the pill and select Month under the continuous section (the second group) to get a smooth monthly trend line.
2
Drag Sales to the Rows shelf. Tableau draws a line chart with monthly SUM(Sales) on the Y axis and time on the X axis.
3
Drag Category to the Color channel. Three separate lines appear — one per Category — each in a distinct colour, letting you compare trends across Furniture, Technology, and Office Supplies simultaneously.
4
On the Marks card, open the mark type dropdown and select Line if not already set. Then click Size and increase the line weight slightly for readability on dashboards. Click Label and check Show mark labelsMin/Max to label only the peak and trough.

Line Chart — Labelled Mockup

SUM(Sales) by Month — coloured by Category
$80K $60K $40K $20K Jan Mar May Jul Sep Nov Dec $72K
Technology
Furniture
Office Supplies

Discrete vs Continuous Dates on the Columns Shelf

The date pill colour tells you exactly how Tableau is treating the date field. A blue pill means discrete — the date is treated as a category label (e.g. "2022", "2023") and produces separate bars or points with gaps between them. A green pill means continuous — the date is treated as a numeric axis that flows without interruption. For line charts showing trends over time, always use a continuous (green) date pill so the line connects smoothly.

Discrete Date (blue pill)
Groups data into labelled buckets. YEAR produces 2021, 2022, 2023 as separate columns with visible gaps. Good for bar charts comparing year-over-year.
Continuous Date (green pill)
Treats time as a flowing numeric axis. MONTH produces a smooth line that connects Jan 2021 through Dec 2023 without gaps. Essential for trend line charts.

Bar vs Line — Choosing the Right Chart

Scenario Right chart Reason
Comparing Sales across 17 product categories Bar Categories have no inherent order — bar length is the clearest comparison
Showing monthly revenue over 3 years Line Time is continuous and ordered — the slope tells the trend story
Comparing annual totals for 4 years Bar Only 4 data points — bar heights are clearer than a 4-point line
Tracking three KPIs each month over a year Multi-line Three coloured lines let you compare trend direction and magnitude simultaneously
📌 Teacher's Note

The most common beginner mistake with line charts is using a discrete date pill and wondering why the line looks like disconnected dots or separate vertical bars. Always check the pill colour before troubleshooting. Blue pill on a date field means Tableau is treating time as a category — right-click the pill, go to the lower section of the date options (the continuous ones), and select the level you need. Green pill means continuous — the line will connect. For bar charts, the most common mistake is forgetting to sort. An unsorted bar chart forces the reader to scan every bar to find the largest — sort descending and the story tells itself in the first two seconds.

Practice Questions

1. A line chart shows disconnected points instead of a smooth connected line. What colour is the date pill on the Columns shelf, and what does it need to be changed to?

2. You have a line chart of SUM(Sales) over time and want to split it into three separate lines — one per Category. What do you do?

3. Two bar charts need to be compared side by side but their axes have different ranges. How do you fix the axis range on one chart to match the other?

Quiz

1. You need to compare total Sales across 17 product Sub-Categories to find the top performers. Which chart type is most appropriate?


2. You want each bar in a horizontal bar chart to display its exact Sales value at the end of the bar. What do you do?


3. A line chart currently shows yearly data with a blue YEAR pill on the Columns shelf. You need it to show a monthly continuous trend instead. What do you do?


Next up — Lesson 22: Area and scatter charts — using filled areas to show cumulative volume and scatter plots to reveal correlation between two measures.