Data Science and Visualization

Chapter 8
Interactive Visualization, Dashboards and Data Storytelling

Bachelors Program in Computer Applications
Data Science and Visualization   •   Bachelor

Interactive Visualization, Dashboards and Data Storytelling

Introduction

Data visualization is the transformation of data into visual representations that support exploration, explanation and decision-making. Static charts are useful for reports, but interactive visualizations allow users to filter, zoom, select, compare and investigate data. Dashboards combine multiple visual elements into an operational interface, while data storytelling connects evidence, interpretation and recommended action.

In professional settings, visualization is not merely a matter of choosing attractive colours. It involves understanding the analytical question, selecting suitable encodings, defining meaningful key performance indicators (KPIs), communicating uncertainty and designing an experience appropriate for technical and managerial audiences. A poor dashboard can create false confidence, hide important exceptions or encourage decisions based on irrelevant metrics.

This chapter develops a practical framework for creating interactive charts, maps, dashboards and narrative presentations using tools such as Python visualization libraries, R Shiny, Tableau, Power BI and web technologies. Tool syntax differs, but the underlying principles are transferable.

Learning Objectives

By the end of this chapter, students should be able to:

  1. Distinguish exploratory, explanatory and operational visualization.
  2. Select appropriate charts, maps and interaction techniques for different data types.
  3. Design dashboards around users, decisions and KPIs.
  4. Construct a narrative that connects context, evidence, uncertainty and action.
  5. Evaluate accessibility, integrity, usability, privacy and governance risks.
  6. Recommend suitable tools and assess their limitations.

1. From Static Charts to Interactive Visual Systems

A visualization can serve three related purposes:

  • Exploration: The analyst investigates patterns, anomalies and relationships. The final visual may change repeatedly.
  • Explanation: A specific finding is communicated to an audience through a carefully edited chart or story.
  • Monitoring: Users repeatedly inspect current conditions, thresholds and exceptions, often through a dashboard.

Interaction is valuable when it reduces cognitive effort or reveals legitimate detail. Common interactions include:

InteractionTypical purposeRisk if poorly designed
FilterRestrict data to a region, period or categoryUsers may unknowingly view an unrepresentative subset
Drill-downMove from aggregate to detailed recordsUsers may lose the overall context
Zoom and panInspect dense temporal or spatial dataImportant patterns may disappear at another scale
Hover tooltipShow exact values or metadataExact values can be mistaken for greater accuracy
Brushing and linkingHighlight related records across chartsSelection state may be unclear
Parameter controlChange a measure, scenario or thresholdUsers may compare incompatible views

An interactive chart should answer a question more effectively than a static chart. Interaction should not be added merely because a tool supports it. Each control needs a visible purpose, an understandable label and a predictable effect.

2. Visual Encoding and Chart Selection

A chart encodes data through position, length, angle, area, colour, shape, size or connection. Quantitative comparisons are generally easiest when values are encoded by position on a common scale, followed by length. Area, angle and colour intensity are usually less precise for comparison.

Choosing a Chart

Analytical taskSuitable visualizations
Compare categoriesOrdered bar chart, dot plot
Show change over timeLine chart, slope chart, area chart used cautiously
Show a distributionHistogram, box plot, violin plot
Examine a relationshipScatter plot, hexbin plot
Show compositionStacked bar chart; pie chart only for a few simple parts
Show a geographic patternChoropleth, proportional-symbol map, point map
Show a process or networkFlow diagram, Sankey diagram, network graph

A time series should normally use a meaningful chronological axis. A line joining unrelated categories can imply continuity that does not exist. A bar chart whose vertical axis begins above zero can exaggerate differences; although truncated axes can sometimes be defensible, the truncation must be explicit and the design must not mislead.

The analyst should distinguish counts, rates and percentages. A region with a large population may have the highest number of incidents but a lower incident rate than a smaller region. A rate is commonly calculated as:

Rate = (Number of events ÷ Population at risk) × k

Here, k is a scaling constant such as 1,000 or 100,000. The denominator must represent the relevant population and period. Rates should not be compared when their definitions or denominators differ.

Colour and Accessibility

Use colour to encode a meaningful variable, not to decorate the page. Sequential colour scales suit ordered values from low to high; diverging scales suit values around a meaningful midpoint such as zero or a target. Qualitative palettes suit categories without an intrinsic order.

Colour should not be the only way to distinguish categories. Use labels, patterns, position or shape as supplementary encodings. Designs should be tested for colour-vision deficiencies, sufficient contrast, keyboard operation and screen-reader interpretation. Red–green combinations are particularly problematic when used without additional cues.

3. Interactive Maps

Maps are appropriate when location is central to the question. They are not automatically appropriate for every geographically coded dataset. A map can encourage users to focus on spatial variation even when a ranked table or bar chart would make comparison easier.

Main Map Types

  • Choropleth map: Shades areas according to a rate, percentage or other normalized measure. Raw counts can be misleading because large areas or populations often dominate.
  • Proportional-symbol map: Places circles or symbols at locations, with size representing magnitude. Overlapping symbols and area perception require care.
  • Point map: Shows individual events or locations. It may reveal sensitive information and can become cluttered.
  • Flow map: Shows movement between origins and destinations.
  • Tile or grid map: Aggregates locations into cells, often reducing boundary bias and disclosure risk.

Maps require attention to geographic projection, boundary definitions, missing areas, scale and spatial aggregation. The modifiable areal unit problem occurs when conclusions change because data are aggregated into different geographic units. Spatial autocorrelation also means nearby observations may be more similar than independent observations; a map showing clusters does not by itself establish causation.

For privacy, locations may need to be generalized, masked or aggregated. A dashboard showing the exact location of a vulnerable individual can create substantial harm even when the underlying dataset was lawfully collected.

4. KPI Design and Measurement

A KPI is a selected measure used to monitor progress toward an objective. A metric becomes a KPI only when it is connected to a decision, responsibility and target or reference point.

A useful KPI specification includes:

  1. Name and business meaning.
  2. Numerator and denominator, if applicable.
  3. Data source and refresh frequency.
  4. Population and time period.
  5. Target, tolerance or benchmark.
  6. Owner and intended action.
  7. Known limitations and exclusions.

For example, “average response time” is incomplete unless the organization specifies which requests are included, whether extreme values are retained, and whether the measure is an arithmetic mean or a percentile. The arithmetic mean is:

x̄ = (1 ÷ n) ∑ᵢ₌₁ⁿ xᵢ

where xᵢ is an observation and n is the number of observations. The mean can be strongly affected by unusually large values. The median or a percentile may better represent a skewed service-time distribution.

A dashboard should avoid metric overload. A small number of high-value KPIs, supported by diagnostic detail, is usually more effective than dozens of equally prominent numbers. Leading indicators may signal future performance, whereas lagging indicators describe outcomes already achieved. Both can be useful, but they should not be confused.

5. Dashboard Architecture and Design

A dashboard is a visual information system rather than a collection of charts. Its design should begin with users and decisions.

A Design Workflow

Step 1: Identify the decision. Ask what action the user must take and how frequently.

Step 2: Identify the audience. An executive may require a concise overview, while an analyst may need filters, distributions and record-level detail.

Step 3: Define the data contract. Document fields, types, units, refresh time, missing-value rules and data ownership.

Step 4: Select KPIs and reference values. Display targets, prior periods, benchmarks or control limits where they are meaningful.

Step 5: Create a visual hierarchy. Place the most important information first. Use size, position, whitespace and restrained colour to establish priority.

Step 6: Add diagnostic views. Include trends, breakdowns and exception details that help users understand why a KPI changed.

Step 7: Add interaction deliberately. Filters should be visible, reversible and accompanied by an indication of the current selection.

Step 8: Test with representative users. Observe whether users can find the answer, interpret it correctly and identify an appropriate action.

A common dashboard layout places headline KPIs at the top, trends and comparisons in the centre, and detailed tables or maps below. This is a useful convention but not a universal rule. Mobile dashboards require fewer simultaneous elements and larger controls.

Technical Architecture

A production dashboard often contains four layers:

  1. Data layer: operational databases, files, APIs or warehouse tables.
  2. Preparation layer: validation, transformation, aggregation and semantic definitions.
  3. Visualization layer: charts, maps, filters and interaction logic.
  4. Delivery layer: web application, authentication, caching, monitoring and accessibility support.

Separating these layers improves maintainability. A KPI should ideally be defined once in a governed semantic layer rather than independently recreated in many charts. Caching can improve responsiveness, but the interface must show data freshness so users do not mistake an old result for a current one.

6. Data Storytelling

Data storytelling combines three elements:

  • Data: observed evidence and its limitations.
  • Narrative: the logical sequence that explains what matters.
  • Visuals: perceptual forms that make the evidence understandable.

A practical narrative structure is:

  1. Context: What situation or decision motivates the analysis?
  2. Tension: What changed, differs or requires attention?
  3. Evidence: Which visual findings support the interpretation?
  4. Explanation: What plausible drivers or comparisons help explain the pattern?
  5. Uncertainty: What is not known, and how strong is the evidence?
  6. Action: What should the audience do next?

The narrative should not imply that correlation proves causation. If sales and advertising rise together, the relationship may reflect seasonality, a third variable or reverse causation. A responsible story distinguishes observation from interpretation and recommendation.

Annotations can direct attention to an important date, threshold or event. However, annotations should be evidence-based and should not conceal contradictory data. Narrative emphasis is legitimate; selective omission of relevant evidence is not.

7. Communicating Uncertainty

Uncertainty arises from sampling, measurement error, missing data, model assumptions, data revisions and future variability. A dashboard that presents every value as exact can encourage overconfidence.

For a sample mean, a commonly used approximate 95% confidence interval is:

x̄ ± 1.96 × (s ÷ √n)

Here, x̄ is the sample mean, s is the sample standard deviation, n is the sample size and 1.96 is the standard-normal critical value for an approximate 95% interval when the normal approximation is suitable. For small samples or non-normal conditions, a t critical value or another method may be more appropriate. A confidence interval describes uncertainty in an estimation procedure; it is not a guarantee that a particular future observation will fall inside the interval.

Uncertainty can be shown with error bars, shaded confidence bands, prediction intervals, ranges, scenario views or explicit textual qualification. Error bars must be labelled: they may represent standard deviation, standard error, confidence intervals or another quantity, and these are not interchangeable.

Forecasts should distinguish historical observations from projected values through line style, shading or a clear divider. Users should be told the forecast horizon, model assumptions and revision policy.

8. Tools and Implementation Choices

Different tools suit different contexts:

Tool categoryStrengthsTypical limitations
Spreadsheet toolsRapid prototypes and familiar workflowsWeak reproducibility and version control at scale
Python librariesFlexible analysis, automation and integrationRequires programming and deployment skills
R and ShinyStrong statistical ecosystem and interactive applicationsRequires R expertise and application hosting
Tableau or Power BIRapid business dashboards and governed sharingLicensing, platform dependence and hidden calculation complexity
JavaScript librariesHighly customized web interactionGreater development and accessibility responsibility

A reproducible workflow keeps data preparation, calculations and visual definitions documented. Version control should be used for code and configuration. Tests should verify filters, date logic, denominators, totals and boundary conditions. Security controls should protect credentials and restrict access to sensitive data.

A typical implementation sequence is: load validated data; create a semantic data model; calculate governed measures; render a default view; connect controls to filters; add tooltips and annotations; test performance and accessibility; then deploy with monitoring. Visual polish cannot compensate for incorrect aggregation or a defective join.

9. Applied Case: Illustrative Municipal Service Dashboard

Background

This illustrative case concerns a city service department responsible for waste-collection requests. Managers want to reduce delayed collections and allocate field teams more effectively. Residents submit requests through a call centre and mobile application.

Problem

The existing monthly report shows total requests but does not identify where delays occur, whether performance differs by service type, or whether a high volume reflects population differences. Managers need an operational dashboard updated daily.

Analysis

The team defines three primary KPIs:

  • On-time completion rate: completed requests within the published service standard divided by all eligible completed requests.
  • Median resolution time: the middle resolution time among eligible completed requests.
  • Backlog: eligible open requests at the refresh time.

The team rejects “total complaints by district” as the main geographic KPI because districts differ substantially in population. It instead displays a rate per 10,000 households, with the denominator and period shown in the metadata.

Data quality checks identify duplicate request IDs, missing completion timestamps and records whose completion precedes submission. Invalid records are excluded from KPI calculations but counted in a data-quality indicator.

Approach and Solution

The dashboard contains:

  1. KPI cards showing current values, targets and refresh time.
  2. A seven-day line chart showing on-time completion and backlog.
  3. A district map using normalized rates rather than raw counts.
  4. A bar chart ranking service types by median resolution time.
  5. A table of overdue requests with controlled access to address-level information.
  6. Filters for date, district and service type, with a visible “all records” reset option.

A tooltip defines each KPI. A shaded band marks the target range. Forecasts are not added until the department has sufficient historical data and a validated forecasting process.

Outcome

During user testing, managers initially interpreted a rise in backlog as a deterioration in performance. The team added a companion chart showing incoming requests and completed requests, revealing that a temporary storm caused a surge in demand. Managers could then distinguish capacity pressure from routine process failure and deploy additional crews.

The dashboard also revealed that one district had fewer total requests but a higher rate per 10,000 households. This changed resource discussions from absolute volume to equitable service performance.

Learning Points

The case demonstrates that dashboard value depends on definitions, denominators, data quality and decision context. Interactivity helped users investigate the pattern, but it did not replace operational knowledge. Privacy controls were necessary because request records contained addresses and contact details. The story was more credible because it displayed demand, service completion, uncertainty about data quality and the limits of causal interpretation.

10. Limitations, Ethics and Governance

Visualization can amplify bias in the data. Historical records may underrepresent people who lack digital access, and performance metrics may encourage staff to optimize the measured target while neglecting unmeasured quality. Analysts should document coverage, exclusions and known sources of bias.

Privacy principles include data minimization, purpose limitation, access control, aggregation and retention limits. Personally identifiable information should not appear in a general managerial dashboard unless necessary and authorized. Small-cell suppression may be required when a combination of filters could identify individuals.

Governance should establish metric ownership, change approval, audit trails, data lineage and a process for correcting errors. AI-generated narratives or automated chart recommendations can accelerate production, but they may reproduce bias, invent explanations or omit uncertainty. Human review remains necessary, especially in health, finance, education, employment and public-sector decisions.

Regulatory and organizational requirements may include accessibility standards, privacy legislation, records-management rules and sector-specific controls. Compliance is not achieved merely by adding a disclaimer; the underlying data, calculations, access model and interaction design must also be reviewed.

11. Best-Practice Checklist

Before release, ask:

  • Is the decision and audience clearly defined?
  • Are measures, denominators, units and refresh times documented?
  • Does each chart match the analytical task?
  • Are filters visible, reversible and correctly applied?
  • Are missing values and exclusions disclosed?
  • Is uncertainty represented where it affects interpretation?
  • Can users distinguish observation, explanation and recommendation?
  • Does the design work with keyboard navigation and assistive technology?
  • Is sensitive information protected?
  • Have calculations, performance and usability been tested with realistic data?
  • Can another analyst reproduce the result?

Chapter Summary

Interactive visualization supports exploration, explanation and monitoring by allowing users to filter, drill down, zoom and connect multiple views. Effective chart selection depends on the analytical task, data type and perceptual accuracy of the visual encoding. Maps require appropriate normalization, geographic reasoning and privacy protection. Dashboards should be designed around decisions, audiences and governed KPI definitions rather than around a collection of attractive charts. Data storytelling combines context, evidence, visual emphasis, uncertainty and action while avoiding unsupported causal claims. Reliable implementation requires validated data, layered architecture, reproducibility, accessibility, security and user testing. Ethical practice demands transparency about limitations, protection of sensitive information and responsible use of automation and AI.

Key Terms

KPI: A selected measure linked to an objective, decision, target and owner.

Dashboard: An interactive visual interface that presents measures and evidence for monitoring or decision-making.

Data storytelling: The structured combination of data, narrative and visuals to communicate findings and action.

Exploratory visualization: Visualization used to investigate patterns, anomalies and relationships.

Explanatory visualization: Visualization designed to communicate a selected finding or argument.

Operational dashboard: A dashboard used for frequent monitoring and immediate action.

Drill-down: Moving from an aggregate view to more detailed data.

Brushing and linking: Selecting data in one view to highlight related data in other views.

Choropleth map: A map that shades geographic areas according to a measured value.

Rate: A count normalized by a relevant population or exposure denominator.

Semantic layer: A governed layer containing consistent business definitions and measures.

Data lineage: Documentation of where data originated and how it was transformed.

Confidence interval: An interval produced by a statistical procedure to express estimation uncertainty.

Prediction interval: An interval expressing uncertainty about a future observation or outcome.

Accessibility: Design that enables people with diverse abilities and technologies to use a system.

Data freshness: The time relationship between the displayed data and the current real-world state.

Leading indicator: A measure that may signal future performance.

Lagging indicator: A measure that describes an outcome after it has occurred.

Modifiable areal unit problem: The possibility that spatial conclusions change when aggregation units change.

Data governance: Policies and responsibilities governing data quality, access, definitions and use.

Review Questions

Short Answer Questions

  1. Distinguish exploratory visualization from explanatory visualization.
  2. Why can a choropleth map of raw counts be misleading?
  3. What information should accompany a KPI definition?
  4. Name two interaction techniques and state one purpose of each.
  5. Why should uncertainty be represented in a dashboard?

Long Answer Questions

  1. Explain a complete workflow for designing and evaluating an interactive dashboard.
  2. Compare bar charts, line charts, scatter plots and choropleth maps in terms of analytical purpose.
  3. Discuss how data storytelling can communicate action without overstating causation.
  4. Explain the technical and governance layers of a production dashboard.
  5. Evaluate the ethical and accessibility responsibilities of a data visualization team.

Analytical / Application Questions

  1. A district has 800 service incidents among 40,000 households, while another has 500 incidents among 10,000 households. Calculate each rate per 10,000 households and explain which district has the higher normalized burden.
  2. Design a dashboard for a university retention team. Specify three KPIs, their denominators, suitable visualizations, users, interaction controls and at least two uncertainty or data-quality disclosures.
  3. A manager claims that advertising caused a rise in sales because both increased during one quarter. Construct a responsible visualization and analytical narrative that distinguishes correlation, alternative explanations and the evidence needed for a causal conclusion.

Multiple Choice Questions with Answers

Question 1

Which visualization is generally most suitable for comparing values across ordered categories?

A. Ordered bar chart

B. Pie chart with many slices

C. Network graph

D. Geographic satellite image

Correct Answer: A. Ordered bar chart

Question 2

Why is a rate often preferable to a raw count when comparing regions?

A. A rate removes all uncertainty

B. A rate accounts for differences in the relevant population or exposure

C. A rate always proves causation

D. A rate does not require a denominator

Correct Answer: B. A rate accounts for differences in the relevant population or exposure

Question 3

Which interaction allows a user to move from an aggregate value to more detailed records?

A. Drill-down

B. Animation loop

C. Colour inversion

D. Axis truncation

Correct Answer: A. Drill-down

Question 4

What is a primary purpose of a semantic layer?

A. To add decorative images

B. To define governed and consistent business measures

C. To eliminate the need for data validation

D. To hide the data source from all users

Correct Answer: B. To define governed and consistent business measures

Question 5

Which colour scale is most appropriate for values diverging around a meaningful midpoint such as zero?

A. Qualitative

B. Diverging

C. Random categorical

D. Single unstructured colour

Correct Answer: B. Diverging

Question 6

In the expression Rate = (events ÷ population) × 1000, what does 1000 represent?

A. The sample size

B. The scaling constant

C. The confidence level

D. The measurement error

Correct Answer: B. The scaling constant

Question 7

What does a confidence interval primarily communicate?

A. Certainty that every future observation lies within the interval

B. Uncertainty associated with an estimation procedure

C. Proof that two variables are causally related

D. The exact value of a population parameter

Correct Answer: B. Uncertainty associated with an estimation procedure

Question 8

Which is an important privacy risk in a point map?

A. It may reveal the exact location of a sensitive event or person

B. It cannot display any geographic information

C. It always uses a diverging colour scale

D. It automatically removes identifying information

Correct Answer: A. It may reveal the exact location of a sensitive event or person

Question 9

Which statement best describes a dashboard KPI?

A. Any number displayed in a report

B. A selected measure connected to an objective, target and decision

C. A decorative chart title

D. A database password

Correct Answer: B. A selected measure connected to an objective, target and decision

Question 10

Why should a storytelling visualization distinguish observations from explanations?

A. To make the chart more colourful

B. To avoid presenting interpretations or causal claims as established facts

C. To remove the need for evidence

D. To ensure every chart uses a map

Correct Answer: B. To avoid presenting interpretations or causal claims as established facts

Data Science and Visualization
Chapter 8 of 15