Skip to main content
Data Visualization
CHAPTER 23 Beginner

Data Visualization for Business Intelligence

Updated: May 18, 2026
5 min read

# CHAPTER 23

Data Visualization for Business Intelligence

1. Chapter Introduction

Business Intelligence transforms raw data into actionable insights for decision-makers. This chapter builds the BI visualization toolkit: KPI scorecards, funnel charts, waterfall charts, and executive dashboards.

2. Executive KPI Scorecard

python
123456789101112131415161718192021222324252627282930313233343536
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import numpy as np

fig = plt.figure(figsize=(16, 10))

def bullet_chart(ax, label, actual, target, poor, good, unit='$', color='#1565C0'):
    """Bullet chart — compact KPI visualization with target and ranges."""
    ax.barh(0, poor,   height=0.8, color='#FFCDD2', zorder=1)   # Poor zone (red)
    ax.barh(0, good,   height=0.8, color='#FFF9C4', zorder=1)   # Ok zone (yellow)
    ax.barh(0, actual, height=0.5, color=color, zorder=2)        # Actual value
    ax.axvline(x=target, color='black', linewidth=3, zorder=3)    # Target marker
    ax.text(-0.02, 0, label, ha='right', va='center', fontsize=11, fontweight='bold', transform=ax.get_yaxis_transform())
    ax.text(actual + poor*0.02, 0, f'{unit}{actual:,.0f}', ha='left', va='center', fontsize=10, color=color, fontweight='bold')
    ax.set_xlim(0, good * 1.1)
    ax.axis('off')

kpis_data = [
    ('Revenue',     2450000, 2000000, 1500000, 2500000, '$'),
    ('Orders',      8421,    8000,    6000,    9000,    ''),
    ('Cust Sat',    4.2,     4.0,     3.5,     4.5,    ''),
    ('Churn Rate',  3.2,     5.0,     8.0,     5.0,    ''),
    ('Net Margin',  28.5,    25.0,    20.0,    30.0,   '%'),
]

axes = [fig.add_axes([0.15, 0.62 - i*0.12, 0.75, 0.09]) for i in range(len(kpis_data))]
colors = ['#1565C0', '#2E7D32', '#E65100', '#6A1B9A', '#B71C1C']

for ax, (label, actual, target, poor, good, unit), color in zip(axes, kpis_data, colors):
    bullet_chart(ax, label, actual, target, poor, good, unit, color)

fig.text(0.5, 0.97, 'Executive KPI Scorecard — Q4 2024', ha='center',
          fontsize=15, fontweight='bold')
fig.text(0.5, 0.93, '■ Actual   | Target', ha='center', fontsize=11, color='#666')
plt.savefig('kpi_scorecard.png', dpi=150, bbox_inches='tight')
plt.show()

3. Funnel Chart

python
12345678910111213141516
import plotly.graph_objects as go

# Sales funnel
stages = ['Website Visitors', 'Product Views', 'Add to Cart', 'Checkout', 'Purchase']
values = [100000, 42000, 18000, 9500, 6200]
colors = ['#1565C0', '#1976D2', '#2196F3', '#42A5F5', '#4CAF50']

fig = go.Figure(go.Funnel(
    y=stages, x=values,
    textinfo='value+percent initial+percent previous',
    marker={'color': colors},
    connector={'line': {'color': '#EEEEEE', 'width': 2}}
))
fig.update_layout(title='E-Commerce Sales Funnel — Conversion Analysis',
                   template='plotly_white', height=450)
fig.show()

4. Waterfall Chart (P&L)

python
123456789101112131415161718192021222324
import plotly.graph_objects as go

# Profit & Loss waterfall
categories = ['Revenue', 'COGS', 'Gross Profit', 'Opex', 'EBITDA', 'D&A', 'EBIT', 'Tax', 'Net Profit']
values     = [5000000, -2200000, 0, -1300000, 0, -180000, 0, -384000, 0]
measure    = ['absolute', 'relative', 'total', 'relative', 'total', 'relative', 'total', 'relative', 'total']

fig = go.Figure(go.Waterfall(
    name='P&L Waterfall',
    orientation='v',
    measure=measure,
    x=categories,
    y=values,
    text=[f'${v:,.0f}' if v != 0 else '' for v in values],
    textposition='outside',
    connector={'line': {'color': '#CCCCCC'}},
    increasing={'marker': {'color': '#4CAF50'}},
    decreasing={'marker': {'color': '#F44336'}},
    totals={'marker': {'color': '#1565C0'}}
))
fig.update_layout(title='P&L Waterfall Chart — Annual Income Statement',
                   template='plotly_white', height=500,
                   yaxis={'tickprefix': '$', 'tickformat': ',.0f'})
fig.show()

5. Common Mistakes

  • Funnel charts without conversion rates: A funnel showing only raw numbers hides the conversion insight. Always show % of initial and % step-to-step.
  • Waterfall with wrong measure types: Using 'absolute' for subtraction steps creates wrong totals. Each step-from-previous must be 'relative'.

6. MCQs

Question 1

Bullet chart shows?

Question 2

Funnel chart measures?

Question 3

Waterfall chart is best for?

Question 4

measure='total' in waterfall?

Question 5

textinfo='percent initial' in funnel shows?

Question 6

BI dashboard primary purpose?

Question 7

Executive scorecard priority?

Question 8

connector in waterfall chart connects?

Question 9

Funnel conversion rate "checkout→purchase"?

Question 10

measure='relative' in waterfall means?

7. Interview Questions

  • Q: What is a waterfall chart and when is it used in business analysis?
  • Q: How do you build a sales funnel visualization?

8. Summary

BI visualization toolkit: bullet charts for KPI vs target, funnel charts for conversion analysis, waterfall charts for P&L decomposition. Always show conversion rates in funnels. Use measure='total' for running totals in waterfall. Executive scorecards should show only 5-7 critical metrics with clear target vs actual.

9. Next Chapter Recommendation

In Chapter 24: Visualization Best Practices, we codify the professional standards for chart readability, clarity, and effective communication.

Finish this Chapter

Save your progress on your learning path and prepare for coding interview challenges.

Discussion

Join the discussion

Log in or create a free account to participate.

Sort: ·