DataCorp now has official metrics, calculated in one place and served by certified tables. One last step of the analysis cycle remains before the decision: communicating. A correct figure that is not understood, or is misunderstood, is as useless as a wrong one, and more dangerous, because it carries the "official data" seal.
Data visualization is the graphical representation of information so that a person can grasp it at a glance. It is not decoration: it is the interface between the data platform and whoever decides. And, like every interface, it has requirements that fall on the architecture: response times, visible freshness, security and governance that keeps dashboards from multiplying out of control.
In this lesson we will see how to choose the right chart for each question, the principles that make a chart honest and readable, the types of visual product and the design of a dashboard, with DataCorp's sales dashboard as the example. We will build two charts with Python and finish with what visualization demands of the architecture and with dashboard governance. The comparison of BI tools was already made in lesson 05-02 and is not repeated here.
What visualizing is for
The human visual system detects patterns (a trend, a peak, an out-of-the-ordinary value) much faster in an image than in a table. A table with the 31 days of October forces you to read 31 numbers; a line shows in one second that sales rise on weekends.
Moreover, numerical summaries can hide what is essential. The classic example is Anscombe's quartet: four datasets with the same mean, the same variance and the same correlation which, when plotted, turn out to be completely different (a linear cloud, a curve, a straight line with an outlier...). Only the chart reveals the difference.
Visualization serves two different functions, and confusing them is a common mistake:
- Exploring: quick, disposable charts that analysts make for themselves, to understand the data. Speed matters, not polish.
- Explaining: charts designed for another person, who must understand a specific message. Clarity matters, and every element must justify itself.
Choosing the chart according to the question
The type of chart is not chosen by taste or for variety: it is determined by the question you want to answer.
| Question | What you want to see | Suitable charts | Example at DataCorp |
|---|---|---|---|
| Comparison | Which item is larger or smaller | Bars (horizontal if the labels are long) | Net sales by category |
| Trend | How something changes over time | Lines; bars if there are few periods | Daily net sales in October |
| Composition | How a total is split | Stacked bars; a pie only with two or three slices | Share of each category in the month |
| Distribution | How the values are spread | Histogram, box plot | Order amounts |
| Relationship | Whether two quantities vary together | Scatter plot | Cost and attributed sales of each campaign |
| Geographic | Where it happens | Map; often, sorted bars are better | Net sales by city |
| A single value | How an indicator is doing | A large figure with its comparison | Net sales for the month against the target |
Three rules of thumb:
- The bar is the safe choice. The eye compares lengths very precisely, and angles and areas very poorly. That is why sorted bars almost always beat a pie.
- Time goes on the horizontal axis, from left to right.
- A map only adds value if geography matters. A map of sales by city usually shows where more people live. If the question is "which city sells the most", sorted bars answer it better.
Design principles
A good chart is not the most eye-catching one: it is the one that conveys the right message with the least effort for the reader.
Maximize the data-ink ratio. The statistician Edward Tufte proposed measuring which part of a chart's "ink" represents data and which part is ornament. Thick gridlines, backgrounds, shadows, borders and redundant legends compete with the data. The rule is to remove everything that can be removed without losing information.
Honest axes. In a bar chart, the axis must start at zero, because the length of the bar is the data; truncating it exaggerates the differences, as we will see in the example. In a line chart it may not start at zero if this is clearly indicated, because what you read is the slope. Two vertical axes with different scales in the same chart suggest relationships that do not exist: two aligned charts are better.
Color with intent. Color is a scarce resource. It is used to highlight (one series in color and the rest in gray), to distinguish categories (few: more than six or seven colors cannot be told apart) or for a magnitude (a gradient). It is not used to decorate. The same concept must always have the same color in every chart of a dashboard.
Accessibility. Roughly one in twelve men has some difficulty distinguishing colors, especially red and green. A dashboard that encodes "good" and "bad" only with green and red is unreadable for them. Use colorblind-safe palettes and reinforce color with another channel: an icon, a sign, a label. Sufficient contrast and a readable font size count too.
Order. Categories are sorted by value, not alphabetically, unless they have a natural order (months, age brackets, the steps of a funnel).
Titles and annotations. The title should state the message, not just the content: "Net sales grew 5.1% in October" says more than "Monthly net sales". An annotation on the relevant point ("stockout of the X2 vacuum cleaner") saves an explanation. The units and the period must always be shown.
What to avoid.
- 3D effects. Perspective distorts lengths and areas, and adds no data.
- Pies with many slices. Beyond four or five, nobody compares the angles. Use bars.
- Too many series in one chart. Ten intertwined lines cannot be read. Highlight one or split into several small charts with the same scale.
- Excess precision. "€2,828,429.75" on a management card is noise; "€2.83M" can be read. The detail is left for the table.
Types of visual product
Not everything that shows data is a dashboard. It is worth distinguishing five products, because each has a different audience, pace and set of demands.
| Product | What it is for | Audience | Typical freshness | Example at DataCorp |
|---|---|---|---|---|
| Operational dashboard | Watching over operations and acting immediately | Those who execute | Minutes | Stock levels and stockout alerts (UC-03) |
| Tactical dashboard | Tracking the performance of an area and detecting deviations | Middle managers, analysts | Daily | Campaign performance (UC-02) |
| Strategic dashboard | Tracking the company's objectives | Management | Daily to monthly | Sales for Management (UC-01) |
| Report | Documenting a period or a matter, with text and context | Varies | That of the period close | Monthly sales report for the committee |
| Exploratory analysis | Answering a new question | The analyst themselves | Whatever is needed | A notebook on the drop of Home in Valencia |
A dashboard is a screen that brings together the indicators needed to track an objective, designed to be consulted on a recurring basis. The typical mistakes come from mixing products: a strategic dashboard with forty charts (it is a report in disguise), an operational dashboard with yesterday's data (it does not let you act) or an exploratory analysis published as if it were official.
Designing a dashboard
The design starts with six questions, and none of them has to do with the tool:
- Audience. Who is going to use it, with what knowledge and on what device?
- Question. What question does it answer? If it does not fit in one sentence, it is several dashboards.
- Indicators. Which key performance indicators (KPIs) answer that question? Between three and six; all of them must be official metrics.
- Context. What is each figure compared with? An isolated number says nothing: it needs the target, the previous period or the same period last year.
- Visual hierarchy. What should be seen first? The most important thing goes at the top left, and larger. It is read from the general to the particular: indicators, trend, breakdown, detail.
- Filters. What does the user need to change? The essential ones (period, category, city), visible and with a sensible default value. Every added filter multiplies the combinations that the platform must serve quickly.
A simple test validates the result: the five-second test. If a person from the audience cannot say, after looking at the dashboard for five seconds, whether the situation is good or bad, the visual hierarchy is failing.
DataCorp's sales dashboard
Let's apply the six questions to the UC-01 dashboard, identified in the catalog as dashboard.sales:
| Question | Answer |
|---|---|
| Audience | Management committee (Carmen Ruiz and the other directors). Consulted daily, also from a phone |
| Question | How are the month's sales doing against the target, and where do they deviate? |
| Indicators | net_sales, valid_orders, avg_order_value, cancellation_rate |
| Context | Monthly target (€2,750,000 in October) and previous month |
| Hierarchy | Indicators → daily trend → breakdown by category and by city |
| Filters | Period (current month by default), category, city |
The sketch, before opening the tool, can be as simple as this:
+--------------------------------------------------------------------------+ | SALES - MANAGEMENT Period: [Oct 2026] Category City | +------------------+-----------------+-----------------+-------------------+ | NET SALES | VALID ORDERS | AVG ORDER VALUE | CANCELLATION RATE | | 2.83 M EUR | 42,780 | 66.12 EUR | 8.0% | | +5.1% vs Sept. | | | | | 102.9% of target | | | | +------------------+-----------------+-----------------+-------------------+ | Daily trend of net sales (line + 7-day moving average) | | with the reference line of the daily target | +-------------------------------------+------------------------------------+ | Net sales by category | Net sales by city (top 10) | | (sorted horizontal bars) | (sorted horizontal bars) | +-------------------------------------+------------------------------------+ | Data updated as of: Nov 1, 2026 01:55 · Source: certified tables | | daily_net_sales and daily_orders · Owner: Carmen Ruiz | +--------------------------------------------------------------------------+
Design decisions captured in the sketch:
- Four indicators, not twelve. They are the first four branches of the metric tree of lesson 05-03.
- Net sales carry their two comparisons: €2,828,429.75 against September's €2,690,150.40 (+5.1%) and against the target of €2,750,000 (102.9%).
- No pie. Five categories are better compared with bars.
- The footer is part of the design. It states how far the data goes, where it comes from and who is accountable for it. It is the difference between a dashboard and a dashboard you can trust.
- No personal data. The dashboard reads aggregates with
svc_bi; there is nothing to mask.
Example in Python: daily trend and bars by category
BI tools build these charts without programming, but making them once with code helps you understand each decision. The example uses matplotlib, the most widespread charting library in Python, and reads the aggregate table as in lesson 05-02.
from datetime import date
import matplotlib.pyplot as plt
import pandas as pd
PATH = "data/consumption/daily_net_sales/"
BLUE, GRAY = "#1f77b4", "#b0b0b0"
# Read from September 25: the 7-day moving average for October 1
# needs the six previous days
sales = pd.read_parquet(
PATH, columns=["sales_date", "category", "net_sales"],
filters=[("sales_date", ">=", date(2026, 9, 25)), ("sales_date", "<", date(2026, 11, 1))],
)
sales["sales_date"] = pd.to_datetime(sales["sales_date"])
# Daily series (categories and cities are summed) and its 7-day moving average
daily = sales.groupby("sales_date")["net_sales"].sum().sort_index()
avg_7d = daily.rolling(window=7).mean()
october = daily.loc["2026-10-01":"2026-10-31"]
# October sales by category, from smallest to largest for the bar chart
by_category = (sales[sales["sales_date"] >= "2026-10-01"]
.groupby("category")["net_sales"].sum().sort_values())
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(13, 4.5), width_ratios=[2, 1])
# Chart 1: trend. The daily data in gray; the trend, highlighted in color
ax1.plot(october.index, october / 1000, color=GRAY, linewidth=1, label="Daily sales")
ax1.plot(october.index, avg_7d.loc[october.index] / 1000, color=BLUE, linewidth=2.5,
label="7-day moving average")
ax1.set_title("Daily net sales, October 2026", loc="left")
ax1.set_ylabel("Thousands of EUR (excl. VAT)")
ax1.set_ylim(bottom=0) # axis from zero
ax1.legend(frameon=False)
# Chart 2: comparison. Sorted horizontal bars, with the figure on the bar
bars = ax2.barh(by_category.index, by_category / 1000, color=BLUE)
ax2.bar_label(bars, fmt="{:,.0f}", padding=3)
ax2.set_title("Net sales by category (thousands of EUR)", loc="left")
ax2.xaxis.set_visible(False) # the label already gives the value
for ax in (ax1, ax2): # less ink: remove superfluous borders
ax.spines[["top", "right"]].set_visible(False)
fig.text(0.01, 0.01, "Source: consumption.daily_net_sales · Data through October 31, 2026",
fontsize=8, color="gray")
plt.tight_layout(rect=(0, 0.04, 1, 1))
plt.savefig("sales_october_2026.png", dpi=150)What to notice:
rolling(window=7).mean()calculates, for each day, the average of that day and the six before it. Sales have a weekly cycle (more orders on the weekend) that makes it hard to see the trend in the daily series; a 7-day window always contains one day of each kind and neutralizes it. That is why the data is read from September 25: without those days, the average for the first six days of October would be empty.- Color directs attention. The daily series is drawn in thin gray and the moving average in thick blue: the message is the trend.
set_ylim(bottom=0)sets the origin of the axis at zero.barhwithbar_labeldraws horizontal bars with their value next to them, which makes it possible to hide the axis: the same information is not shown twice.spinesremoves the top and right borders of the frame: ink that represents no data.- The footnote states the source and the date of the data, just as on the dashboard.
Before and after: a misleading chart
Suppose someone presents October's growth like this: two bars, September and October, with the vertical axis starting at 2.6 million. The following program draws that version and the corrected one.
import matplotlib.pyplot as plt
months = ["September", "October"]
net_sales = [2_690_150.40, 2_828_429.75] # EUR
millions = [v / 1_000_000 for v in net_sales]
fig, (before, after) = plt.subplots(1, 2, figsize=(10, 4))
# BEFORE: truncated axis. October's bar looks more than twice September's
before.bar(months, millions, color="#d62728")
before.set_ylim(2.6, 2.85)
before.set_title("Misleading: truncated axis")
# AFTER: axis from zero and the change written in the title
after.bar(months, millions, color="#1f77b4")
after.set_ylim(0, 3.2)
after.bar_label(after.containers[0], fmt="{:.2f} M")
change = 100 * (net_sales[1] - net_sales[0]) / net_sales[0]
after.set_title(f"Honest: net sales grew {change:.1f}%")
for ax in (before, after):
ax.set_ylabel("Net sales (millions of EUR)")
plt.tight_layout()
plt.savefig("truncated_axis.png", dpi=150)In the truncated version, September's bar measures 0.09 units above the origin of the axis (2.69 − 2.60) and October's, 0.23 (2.83 − 2.60): visually, October looks like 2.5 times September. The actual growth is 5.1%. The data is the same and it is correct; what lies is the representation.
The corrected version starts at zero, so the heights keep the real proportion, and it writes the change in the title, which is the message. If what you want is to emphasize a small difference, the honest thing is to plot the difference itself (the month-over-month percentage change) or to use a line, not to cut the bars short.
What visualization demands of the architecture
A dashboard is the tip of the architecture, and its qualities depend on what lies beneath.
| Demand | Why | How DataCorp covers it |
|---|---|---|
| Fast response | A dashboard that takes 20 seconds stops being used | RQ-05 (under 5 s at the p95, 10 concurrent users); aggregate tables, result cache and separate query compute (lesson 04-06) |
| Tables at the dashboard's grain | Every filter is a query | daily_net_sales, daily_orders and daily_campaigns (ADR-014) |
| Visible freshness | The user must know how recent the data is, especially if a load fails | "Data updated as of..." caption, obtained from control.runs |
| Single metrics | Two dashboards cannot disagree | Official metrics only (RQ-11) |
| Certified data | Whatever reaches Management must be tested | Published dashboards read certified tables only |
| Security | Each user sees what they are entitled to | Roles in the engine, svc_bi without personal data, row-level security |
| Availability | The dashboard is consulted during business hours | RQ-06 (99.5%) |
Visible freshness deserves a comment. If the nightly load fails, the tests block publication and the dashboard keeps showing the data from the day before yesterday (lesson 04-05). That is correct: old data is better than wrong data. But it is only acceptable if the dashboard says so. The caption is fed by a query like this one:
-- End of the last successful sales load, converted to Spanish mainland time
SELECT MAX(end_time) AT TIME ZONE 'UTC' AT TIME ZONE 'Europe/Madrid' AS data_updated_at
FROM control.runs
WHERE process = 'nightly_load_sales'
AND status = 'succeeded';Row-level security poses a difficulty specific to BI tools. If every dashboard reads with the svc_bi account, the engine does not know which person is behind it and cannot filter by them. There are two solutions: have the tool pass the end user's identity or attributes to the engine, or publish different dashboards per audience, each on an already filtered view. For the case anticipated in lesson 03-04 (each warehouse manager sees only their own), DataCorp opts for the second, which is simpler with three warehouses.
Warning. A dashboard can expose personal or confidential data through filters, drill-downs or exports. Before publishing dashboards with that kind of data, the permission configuration must be reviewed by the security officer or the compliance officer.
Dashboard governance
The risk of self-service pointed out in lesson 05-01 materializes here: without governance, in a year there will be hundreds of dashboards, most of them abandoned, several contradictory and none clearly official. Three measures prevent it.
Owner. Every published dashboard has a business owner, who is accountable for it remaining useful, and belongs to one of two categories: official (reviewed, on certified data, with a visible badge) or personal (exploration, with no guarantees).
Catalog. Official dashboards are registered as one more asset, with a datasheet alongside those of the tables. That way they enter the lineage: if daily_net_sales changes, the impact analysis of lesson 03-02 points out which dashboards are affected.
# governance/datasheets/dashboard.sales.yaml
asset: dashboard.sales
title: Sales - Management
type: strategic_dashboard
question: How are the month's sales doing against the target, and where do they deviate?
owner: [email protected]
steward: [email protected]
audience: management committee
metrics: [net_sales, valid_orders, avg_order_value, cancellation_rate]
sources: [consumption.daily_net_sales, consumption.daily_orders]
freshness: D+1 before 07:00
classification: internal
status: official
next_review: 2027-06-01Retirement. A dashboard that nobody opens has a cost: it clutters searches, consumes refreshes and may show a definition that has already been retired. The BI tool records the views, and with them a simple rule is applied: an official dashboard with no views in 90 days is raised with its owner and, if it cannot be justified, archived; personal ones unused for 180 days are archived automatically. Archiving is not deleting: it can be restored.
DataCorp's initial set of official dashboards is deliberately short: one per use case.
| Dashboard | Type | Use case | Owner |
|---|---|---|---|
dashboard.sales |
Strategic | UC-01 | Carmen Ruiz |
dashboard.campaigns |
Tactical | UC-02 | Nuria Vidal |
dashboard.stock |
Operational | UC-03 | Tomás Herrero |
dashboard.funnel |
Tactical | UC-04 | Nuria Vidal |
dashboard.issues |
Tactical | UC-05 | Rosa Molina |
Common Mistakes and Tips
- Starting from the tool and not from the question. The result is a dashboard with every chart the tool allows and no answer.
- Too many indicators. If everything is important, nothing is. Three to six per dashboard.
- Figures without context. "42,780 orders" does not say whether that is good or bad.
- Truncated axes on bars, 3D and pies with many slices. They distort the comparison.
- Red and green as the only code. It excludes part of the audience.
- Not showing the date of the data. The day a load fails, someone will decide with old data believing it is yesterday's.
- Recalculating metrics in the dashboard. It reintroduces the problem that the semantic layer solved.
- One dashboard for every audience. Management and operations need different screens on the same data.
- Publishing and forgetting. Dashboards age with the business; without review or retirement, they pile up.
- Tip: draw the sketch on paper and validate it with a real user before building anything.
- Tip: measure usage. A dashboard that nobody opens is not a success, however well designed it is.
Exercises
Exercise 1: Choosing the chart
State which type of chart you would use in each case and why:
- Monthly net sales for the last 24 months.
- October net sales in the 15 cities with the highest sales.
- The amount of the 42,780 valid orders in October, to find out what the typical order is.
- Share of valid orders and of cancelled and returned orders in the month's total.
- Cost and attributed net sales of 30 campaigns, to detect the inefficient ones.
Exercise 2: Reviewing a dashboard
Marketing has built a campaign dashboard with: a 3D pie with the 12 active campaigns; a bar chart of ROAS whose axis starts at 2; the figure "sales", calculated in the dashboard itself as the sum of total_amount; red and green traffic lights with no text, and no indication of the date. List the problems and propose a fix for each one.
Exercise 3: Specifying an operational dashboard
Fill in the six design questions for dashboard.stock (UC-03) and state what it demands of the architecture that the sales dashboard does not.
Solutions
Exercise 1
- Lines. It is a trend with many periods; it lets you see trend and seasonality.
- Sorted horizontal bars. It is a comparison, and city names are easier to read horizontally. A map would add nothing.
- Histogram (or box plot). It is a distribution; the mean alone (€66.12) would hide its shape.
- A stacked bar or two figures. With only two parts (92% and 8%) a pie would be acceptable, but a figure with its percentage is enough.
- Scatter plot, with the cost on one axis and the attributed sales on the other. The inefficient campaigns fall below the general trend.
Exercise 2
| Problem | Fix |
|---|---|
| 3D pie with 12 slices | Sorted horizontal bars, without 3D |
| Bar axis that starts at 2 | Axis from zero |
"Sales" calculated in the dashboard with total_amount |
Use attributed_net_sales: the sum of total_amount is gross sales, includes VAT and cancelled and returned orders, and contradicts ADR-014 |
| Red/green traffic lights with no text | Add an icon or a label and a colorblind-safe palette |
| No date of the data | "Data updated as of..." caption |
In addition, twelve campaigns with the same visual weight give no hierarchy: it is better to head the dashboard with the overall ROAS and the total cost, and leave the detail per campaign below.
Exercise 3
| Question | Answer |
|---|---|
| Audience | Warehouse and purchasing managers; warehouse screen and computer |
| Question | Which products are about to run out, and where? |
| Indicators | Products on alert, products out of stock, days of cover |
| Context | Alert threshold and replenishment lead time |
| Hierarchy | Number of alerts → list sorted by urgency → detail by warehouse |
| Filters | Warehouse (by default, the user's own), category |
It demands three additional things: 15-minute freshness (RQ-04), which requires a live query with a very short cache on consumption.current_stock; the update time visible to the minute, and security by warehouse. Tip: an operational dashboard is designed for acting, not for analyzing; a sorted list of what to replenish is worth more than any chart.
Conclusion
Visualizing means giving data a graphical form so that whoever decides understands it at a glance, and it is the step where correct data can still turn into a mistaken conclusion. The type of chart is determined by the question: bars to compare, lines for the trend, histograms for the distribution, scatter plots for the relationship. The design principles pursue one and the same goal: less superfluous ink, honest axes, color that is intentional and accessible, order, and titles that state the message. Visual products are distinguished by their audience and their pace (operational, tactical and strategic dashboards, reports and exploratory analyses), and a dashboard is designed by answering six questions before opening the tool. All of this rests on the architecture: aggregate tables that respond in under five seconds, visible freshness, single metrics, certified data and permissions defined in the engine; and on governance that assigns an owner to each dashboard, catalogs it and retires those that are no longer used.
DataCorp now has all the pieces of analysis: the types of analysis and their consumers, the tools, the official metrics and the criteria for communicating them. What remains is to check that they fit together. In the next lesson we will walk, end to end, through the six use cases that have guided the design since the first module, to see how each one crosses the architecture from the source to the decision.
