Assignment 5-A

Data Visualization Dashboard

Apply your visualization skills to create a comprehensive, interactive dashboard that transforms raw business data into actionable insights using Matplotlib, Seaborn, and Plotly.

5-6 hours
Advanced
100 Points
Submit Assignment
What You'll Practice
  • Matplotlib figure composition
  • Seaborn statistical plots
  • Plotly interactive charts
  • Dashboard layout design
  • Data storytelling

Assignment Overview

In this comprehensive assignment, you will work as a Data Visualization Specialist at TechMetrics Analytics. The company needs you to create a professional dashboard that visualizes key performance indicators (KPIs) from their e-commerce platform, helping stakeholders make data-driven decisions.

Objectives
  • Design multi-panel dashboard layouts
  • Create publication-quality static charts
  • Build interactive Plotly visualizations
  • Apply consistent styling and themes
  • Implement responsive chart designs
  • Export charts in multiple formats
Skills Tested
  • plt.subplots, GridSpec layouts
  • Seaborn themes and palettes
  • Plotly Express and Graph Objects
  • Color theory and accessibility
  • Annotations and legends
  • Figure export and optimization
Deliverables
  • visualization_dashboard.ipynb (notebook)
  • 6 exported PNG charts
  • interactive_dashboard.html
  • README.md

The Scenario

📧 Email from Marcus Johnson, VP of Business Intelligence

"Welcome to TechMetrics! We have a board meeting next week, and I need your visualization expertise. Our e-commerce platform has been collecting data for Q1 2024, but our current reports are just tables of numbers. The executives need to see the story behind the data.

I need you to create two things:

  1. Executive Summary Dashboard - A static, print-ready dashboard with 6 key charts that can be included in our board presentation PDF
  2. Interactive Dashboard - A web-based interactive version for the leadership team to explore on their own

The dashboard should cover: revenue trends, customer acquisition, product performance, regional sales distribution, customer segmentation, and conversion funnel analysis. Make it visually stunning but also professional. Our brand colors are deep purple (#6366f1) and emerald green (#10b981).

Looking forward to seeing what you create!"

- Marcus Johnson, VP of Business Intelligence

The Datasets

Download the three datasets below. These contain Q1 2024 e-commerce data that you will visualize.

techmetrics_sales.csv

Transaction-level sales data including timestamps, products, quantities, revenue, and customer IDs.

200 records Q1 2024 data Clean dataset
Download CSV
Columns:
  • transaction_id, date, customer_id, product_id
  • product_name, category, quantity, unit_price, revenue
  • region, city, payment_method, discount_applied
techmetrics_customers.csv

Customer profile data including demographics, acquisition source, and engagement metrics.

60 customers Segmentation data Lifetime value included
Download CSV
Columns:
  • customer_id, signup_date, age_group, gender
  • acquisition_source, customer_segment, lifetime_value
  • total_orders, avg_order_value, days_since_last_order
techmetrics_website.csv

Daily website metrics including traffic, conversion rates, and funnel data.

100 days Funnel metrics Traffic sources
Download CSV
Columns:
  • date, visitors, page_views, bounce_rate
  • cart_additions, checkouts_started, purchases_completed
  • traffic_source, device_type, avg_session_duration

Requirements

Part 1 Chart Styling (15 points)

In your visualization_dashboard.ipynb notebook:
  1. Create a custom color palette with the following colors:
    • Primary: #6366f1 (Indigo)
    • Secondary: #10b981 (Emerald)
    • Accent: #f59e0b (Amber)
    • Danger: #ef4444 (Red)
    • Neutral shades for backgrounds and text
  2. Implement a custom Matplotlib style with:
    • Dark background (#1a1a2e or similar)
    • White/light gray text and gridlines
    • Custom font settings (Inter or similar sans-serif)
    • Consistent figure sizes for dashboard panels
  3. Create helper functions:
    • apply_chart_style(ax) - Apply consistent styling to any axis
    • format_currency(value) - Format numbers as currency ($1.2M, $500K)
    • format_percentage(value) - Format decimals as percentages
    • add_value_labels(ax, fmt) - Add data labels to bar/line charts

Part 2 Static Charts (30 points)

Create 6 charts in your notebook using Matplotlib and Seaborn:
  1. create_revenue_trend_chart(sales_df) - Line chart showing:
    • Daily/weekly revenue trend over Q1 2024
    • Rolling 7-day average as secondary line
    • Shaded area for revenue range (min to max daily)
    • Annotations for peak and low periods
    • Y-axis formatted as currency
  2. create_category_performance_chart(sales_df) - Horizontal bar chart showing:
    • Revenue by product category (sorted descending)
    • Each bar colored by growth rate (green for positive, red for negative)
    • Value labels on each bar
    • Secondary axis showing % of total revenue
  3. create_regional_distribution_chart(sales_df) - Combined chart showing:
    • Pie or donut chart for regional revenue distribution
    • Percentage labels with actual values
    • Legend positioned outside the chart
    • Exploded slice for the top-performing region
  4. create_customer_segmentation_chart(customers_df) - Scatter/bubble plot showing:
    • X-axis: Total orders
    • Y-axis: Average order value
    • Bubble size: Lifetime value
    • Color: Customer segment
    • Quadrant lines showing segment boundaries
  5. create_acquisition_heatmap(customers_df, sales_df) - Heatmap showing:
    • Rows: Acquisition source
    • Columns: Weeks or customer segments
    • Values: Number of new customers or revenue
    • Color scale with diverging colors
    • Annotations on each cell
  6. create_conversion_funnel_chart(website_df) - Funnel visualization showing:
    • Stages: Visitors -> Cart -> Checkout -> Purchase
    • Percentage drop-off between each stage
    • Overall conversion rate highlighted
    • Use horizontal bars or custom funnel shape

Part 3 Interactive Charts (25 points)

Create interactive Plotly charts in your notebook:
  1. create_interactive_revenue_chart(sales_df) - Enhanced line chart with:
    • Hover tooltips showing daily details
    • Range slider for date selection
    • Dropdown to filter by region
    • Toggle buttons for different metrics (revenue, orders, avg order value)
  2. create_interactive_category_chart(sales_df) - Treemap or sunburst showing:
    • Hierarchical view: Category -> Subcategory -> Products
    • Color by growth rate or profit margin
    • Click-to-drill-down functionality
    • Hover details with revenue, quantity, and growth
  3. create_geographic_map(sales_df) - Choropleth or scatter map showing:
    • Sales by region/city as points or colored regions
    • Size/color based on revenue or order count
    • Hover information with city details
    • Zoom and pan functionality
  4. create_animated_timeline(sales_df) - Animated chart showing:
    • Weekly category rankings over time (bar chart race style)
    • Play/pause controls
    • Frame-by-frame navigation
    • Smooth transitions between frames

Part 4 Dashboard Generator (20 points)

In your notebook, create a dashboard generator section that:
  1. Generates a static dashboard that:
    • Creates a 3x2 grid layout using GridSpec or subplots
    • Includes all 6 static charts from Part 2
    • Adds a dashboard title and timestamp
    • Includes KPI summary boxes (Total Revenue, Orders, Customers, Avg Order Value)
    • Exports as high-resolution PNG (300 DPI, 16x12 inches)
  2. Generate interactive dashboard HTML that:
    • Combines all Plotly charts into a single HTML file
    • Uses Plotly's make_subplots or custom HTML layout
    • Includes a header with logo placeholder and title
    • Responsive layout that works on desktop and tablet
    • Self-contained (no external dependencies needed)
  3. Implement command-line interface that:
    • Accepts data file paths as arguments
    • Has options for output format (static, interactive, both)
    • Includes verbose mode for progress logging
    • Handles missing data gracefully with warnings

Part 5 Output Files & Documentation (10 points)

Required Output Files:
  1. Individual Charts (PNG, 300 DPI):
    • revenue_trend.png
    • category_performance.png
    • regional_distribution.png
    • customer_segmentation.png
    • acquisition_heatmap.png
    • conversion_funnel.png
  2. complete_dashboard.png - Combined static dashboard
  3. interactive_dashboard.html - Self-contained interactive dashboard
README.md must include:
  1. Dashboard Overview:
    • Screenshot/preview of the final dashboard
    • Key insights discovered from the visualizations
    • Design decisions and rationale
  2. Technical Documentation:
    • Required dependencies (requirements.txt referenced)
    • How to run the dashboard generator
    • Command-line options explained
  3. Chart Descriptions:
    • Purpose of each visualization
    • Key takeaways from each chart
    • Any interactive features explained

Grading Rubric

Component Points Criteria
Chart Styling Module 15 Consistent theme, reusable functions, professional color palette, accessibility considered
Static Charts (Matplotlib/Seaborn) 30 All 6 charts complete, proper formatting, clear labels, publication-quality output
Interactive Charts (Plotly) 25 Interactive features working, tooltips informative, smooth animations, responsive
Dashboard Generator 20 Layout polished, exports correctly, CLI functional, error handling present
Output Files & Documentation 10 All files present, README comprehensive, insights meaningful
Total 100
Deductions
  • -5 points: Missing required chart or output file
  • -5 points: Charts not rendering correctly or code errors
  • -10 points: Inconsistent styling across charts
  • -5 points: No docstrings or comments in code
  • -5 points: Interactive dashboard not self-contained (requires external files)
Bonus Points (up to 10)
  • +3 points: Exceptionally creative visualization not listed in requirements
  • +3 points: Dark/light theme toggle in interactive dashboard
  • +2 points: Accessibility features (colorblind-friendly palette, alt text)
  • +2 points: PDF export option with proper formatting

Submission

Create a public GitHub repository with the exact name shown below, add all required files, and submit through the submission portal.

github.com/<your-username>/techmetrics-dashboard
Required Files Checklist:
visualization_dashboard.ipynb revenue_trend.png category_performance.png regional_distribution.png customer_segmentation.png acquisition_heatmap.png conversion_funnel.png complete_dashboard.png interactive_dashboard.html README.md

All files are required. Submission will fail if any file is missing.

Pro Tips

Design Best Practices
  • Use a consistent color palette throughout all charts
  • Keep text readable (minimum 10pt font in exports)
  • Use white space effectively, avoid cluttered layouts
  • Add context with titles, subtitles, and annotations
Code Organization
  • Keep chart functions pure (no side effects)
  • Use type hints for better documentation
  • Handle edge cases (empty data, missing columns)
  • Add docstrings with example usage
Time Management
  • Start with the styling module (builds foundation)
  • Create static charts before interactive ones
  • Test each chart individually before combining
  • Leave time for polishing and documentation
Common Pitfalls
  • Forgetting to close figures (memory leaks)
  • Hardcoding file paths instead of using arguments
  • Inconsistent axis scales across similar charts
  • Not testing HTML on different browsers

Pre-Submission Checklist

Visualization Requirements
Deliverables