Chapter 27: MongoDB Charts
1. What exactly is MongoDB Charts? (Big picture – no jargon first)
MongoDB Charts is a fully managed, no-code / low-code data visualization & dashboarding tool created by MongoDB itself.
It lives inside MongoDB Atlas (cloud platform) and lets you:
- Connect directly to your Atlas cluster(s)
- Build interactive charts, graphs, tables, maps, gauges, pivot tables using your real MongoDB data
- Create dashboards by combining multiple charts
- Share dashboards with team members, embed them in apps/websites, or export as PNG/PDF
- All without writing any extra backend code or moving data to another BI tool (Tableau, Power BI, Looker, Metabase, etc.)
In simple teacher words:
MongoDB Charts is “Excel pivot charts + Google Data Studio love child — but living natively inside Atlas, always up-to-date with your live data, zero ETL, zero servers to manage.”
2. Why do people love MongoDB Charts in 2026? (Realistic reasons)
| Reason | Explanation | Typical user who loves it |
|---|---|---|
| Zero data movement | Reads directly from your Atlas cluster — no export/import/copy | Teams tired of nightly ETL jobs |
| Real-time / near real-time | Charts refresh automatically (can be seconds to minutes) | Live dashboards (IoT, e-commerce, gaming metrics) |
| No-code chart builder | Drag-and-drop interface — business users can build charts themselves | Product managers, analysts, founders |
| Understands MongoDB documents natively | Handles nested objects, arrays, $lookup results, geospatial data | Developers who hate flattening data for BI tools |
| Role-based access control | Same Atlas RBAC — no extra users/permissions to manage | Security-conscious companies |
| Embed + public sharing | iframe embed, public links, scheduled PDF reports | Customer-facing portals, investor updates |
| Free tier generous | M0–M10 clusters get Charts free; higher tiers have generous quotas | Startups & side projects |
3. Where do you find MongoDB Charts? (Navigation 2026)
- Log in to https://cloud.mongodb.com
- Select your project
- In left sidebar → Charts (sometimes under Analytics & AI group)
- If first time → click Get Started or Create New Dashboard
4. Hands-on — Let’s Build a Simple Dashboard (Step-by-step)
Assume you already have some data in Atlas — let’s use our familiar school2026 database with students collection.
Example documents:
|
0 1 2 3 4 5 6 7 8 9 10 |
[ { name: "Rahul", age: 16, city: "Hyderabad", marks: {math: 92, science: 85}, joined: ISODate("2025-06-01"), active: true }, { name: "Priya", age: 15, city: "Secunderabad", marks: {math: 95}, joined: ISODate("2025-07-15"), active: true }, { name: "Amit", age: 17, city: "Hyderabad", marks: {math: 68, physics: 72}, joined: ISODate("2024-12-10"), active: false } ] |
Step 1: Create a new data source
In Charts → Data Sources → Connect → select your cluster & database school2026 → authorize → select collection students
Step 2: Create first chart – Average marks per city (bar chart)
- New Chart → choose Vertical Bar
- Data source → your students collection
- X Axis → drag field city (group by)
- Y Axis → drag field marks.math → Aggregation = Average
- Filters (optional) → active = true
- Title → “Average Math Score by City”
- Colors → change to nice palette
- Save → name it “Math by City”
→ You see bars: Hyderabad ~80, Secunderabad 95
Step 3: Add more charts to dashboard
Create these (quickly):
- Pie chart — Distribution by city
- Type: Pie → Group by city → Value: Count
- Number chart — Total active students
- Type: Number → Aggregation: Count → Filter: active = true
- Line chart — Students joined over time
- X: joined (bin by month) → Y: Count
- Scatter plot — Math vs Science marks
- X: marks.math → Y: marks.science → Color by city
Now New Dashboard → drag all 5 charts onto canvas → resize → add title “School Performance Dashboard” → Share (private link or embed code)
5. Quick Reference Table – Most Popular Chart Types in Charts
| Chart Type | Best for showing | Typical fields used | Very common use case |
|---|---|---|---|
| Vertical Bar | Comparison across categories | Group by city/department, value = avg/sum | Sales by region, scores by class |
| Pie / Donut | Part-to-whole (proportions) | Group by status/category, value = count | User status distribution |
| Line / Area | Trend over time | Time field (joined, orderDate), value = sum | Daily signups, revenue trend |
| Number / KPI | Single big metric | Count, sum, avg | Total users, revenue this month |
| Scatter / Bubble | Correlation between two numeric variables | X = one metric, Y = another, size = count | Price vs rating, age vs salary |
| Heatmap | Two-dimensional distribution | X = category1, Y = category2, value = count | Activity by hour & weekday |
| Choropleth Map | Geographic distribution | country/state field | Users per state/country |
6. Important 2026 Notes & Gotchas
- Refresh rate — default 1 hour, can set to 1 minute (paid tiers)
- Query performance — Charts runs real aggregation pipelines → bad performance = slow dashboard → use indexes!
- Row limit — ~100k documents fetched → filter early in data source
- Public embedding — requires public sharing enabled + careful role setup
- Cost — free for small clusters, higher tiers have generous limits, but very large dashboards → consider dedicated BI tools
7. Mini Exercise – Try Right Now (if you have Atlas)
- Go to Atlas → Charts → connect your cluster
- Create bar chart → average something by category
- Create number chart → total documents count
- Put both in one dashboard → share private link with a friend
Understood beta? MongoDB Charts is the fastest way to go from “I have data in Atlas” → “Look, beautiful live dashboard my boss can open in browser” — no code, no servers, no extra cost for small projects.
Next class options:
- MongoDB Charts + $lookup / complex aggregations (advanced dashboards)
- Embedding Charts in Next.js / React app
- Charts vs Atlas SQL + external BI (Tableau, Power BI, Metabase)
- Or build a small “Valentine Movie Ratings Dashboard” using Charts?
Tell me what you want next — class is still full of love for data! 🚀❤️
Any confusion about Charts? Ask freely — we’ll build more examples together 😄
