الدرس 2 · الوحدة 3: Charts, Gauges, Lists and Tables
Serial charts over time: date binning, trend lines and guides
الفيديو قريبًا
Learn it with your tutor on the live board
أهم نقاط الفيديو
Is It Getting Worse?
- Director's question: are water main breaks rising?
- A map of 300 points can't answer it
- Time on the axis can
- Same need for requests, outages, incidents
What You Will Learn
- Bin dates by hour, day, week or month
- Add a trend line and read it honestly
- Add guides for targets, thresholds and events
A Date Field as the Category
- Same serial chart as lesson 1
- Category field is now a date
- Each feature lands in one time bin
- Statistic (count, sum) per bin
Binning in Code
import pandas as pd
d = pd.to_datetime([
"2026-01-04", "2026-01-09",
"2026-01-21", "2026-01-28",
"2026-02-02", "2026-02-15",
"2026-03-11", "2026-04-20",
"2026-05-06",
])
s = pd.Series(1, index=d)
print(s.resample("MS").sum())
print(s.resample("W").sum().head(4)) Date Settings in Dashboards
- Choose the bin period (year down to minute)
- Dates stored in UTC, shown in local time
- Late-night events can shift to the next day
- Decide how empty periods appear
Trend Lines
- Straight line through the monthly values
- Fitted so the squared misses add up to the smallest total
- Slope = change per bin
- Describes the past, not the cause
layout: side
kind: scatter
title: Pothole requests per month
x_label: Month
y_label: Requests
data: [[1, 410], [2, 455], [3, 430], [4, 480], [5, 470], [6, 510], [7, 495], [8, 540], [9, 525], [10, 560], [11, 550], [12, 590]]
steps:
- at: "twelve months of pothole"
show: all
- at: "stretching a ruler"
fit: true
note: Least-squares trend line Guides Add Context
- Value guide: horizontal line at a number
- Category guide: vertical line at a date
- Range guide: shaded band between two values
- Label every guide in plain words
layout: side
kind: line
title: Open outage tickets, storm week
x: [Mon, Tue, Wed, Thu, Fri, Sat, Sun]
data: {Tickets: [38, 42, 160, 210, 150, 90, 50]}
steps:
- at: "during a storm week"
show: all
- at: "normal level of forty-five"
line: {y: 45, label: normal 45}
- at: "the day the storm made landfall"
note: Wednesday = storm landfall (category guide) Worked Example: Weekly Breaks
- Layer: water main breaks, field reported_date
- Bin by week, statistic count
- Linear trend line
- Value guide: last winter's weekly average
Read It Out Loud
- Weeks above the guide = worse than normal
- Upward slope = rising over the period
- Spikes near cold snaps: add a date guide
- One sentence the director can repeat
Common Mistake: The Partial Last Bin
- Current week or month is still filling up
- Looks like a sudden drop
- Drags the trend line down
- Fix: filter to complete periods, or label it
Recap
- Bin dates to match the question (12 to 60 bins)
- Trend lines show direction, not cause
- Guides and honest last bins give context
Your Exercise
- Pick a layer with a date field (requests, incidents, outages)
- Build a serial chart binned by week
- Add a trend line and one labelled guide
- Check the last bin; write your one-sentence message
النص المكتوب
Is It Getting Worse?. It's February, and the utilities director asks one question in the morning meeting: are water main breaks getting worse, or does it just feel that way? You open the dashboard and see three hundred break points scattered across the map. Every point is real, but none of them answers her question. She needs time on the horizontal axis. That means breaks per week this winter, compared with a normal level, and a line showing which way things are heading. That's a serial chart over time, and in this lesson you'll build exactly that. The same chart works for service requests after a holiday weekend, power outages during a storm, and traffic incidents after a road layout changes.
What You Will Learn. By the end of this lesson you'll be able to do three things. First, turn a date field into a clean time axis by grouping features into periods, and pick a period size that fits your question. Second, add a trend line and explain in plain words what it shows and what it doesn't. Third, add guides. Guides are reference lines and bands that give your viewers context, such as a service target or the day a storm arrived. Together these three tools turn a busy chart into an answer that a manager can read in five seconds.
A Date Field as the Category. In lesson one you grouped features by a text field, such as request status. Now pick a date field instead, such as the date a break was reported. ArcGIS Dashboards recognizes the date and builds a time axis. Then it asks how to bin the dates. Binning means sorting dates into periods of the same kind, such as weeks or months, the way a mail room sorts letters into pigeonholes labelled with each week. Every break falls into exactly one pigeonhole. The chart then applies your statistic to each pigeonhole. That's usually a count, but it could be a sum, such as total customers affected by outages that week.
Binning in Code. Here's the same idea in a few lines of Python, with nine sample break dates. Resample by month start groups them into monthly bins, and January shows four breaks. Resample by week groups the same dates into weeks, which gives more, smaller bins. Choosing the bin size is the key decision. Small bins show detail but look noisy. Large bins look smooth but can hide a spike. A useful rule of thumb is to aim for roughly twelve to sixty bins across the time you're showing. For a year of breaks, that means weeks or months. For a two-day storm, it means hours.
Date Settings in Dashboards. In ArcGIS Dashboards, the serial chart's data settings let you pick the period, from year down to minute. Two details deserve attention. First, ArcGIS Online stores dates in UTC, which is universal time, and shows them in the viewer's time zone. A break logged at eleven at night might therefore land in the next day's bin if the time zones were handled differently when the data was loaded. Check a few records against the source system. Second, decide what an empty period means. A week with no breaks is a real zero, so show it as zero rather than leaving a gap that viewers might read as missing data.
Trend Lines. Here are twelve months of pothole service requests. The months bounce up and down, so it's hard to judge the overall direction by eye. A trend line settles it. Picture stretching a ruler through the cloud of dots and nudging it until the vertical misses, each one squared and then added up, are as small as possible. Statisticians call this least squares. The tilt of the line, called the slope, tells you how many requests each month adds on average. Be honest about its limits. A trend line describes what already happened. It doesn't explain why, and it isn't a forecast.
Guides Add Context. Guides are fixed reference marks drawn on the chart. Here are open outage tickets during a storm week. Add a value guide, which is a horizontal line, at the normal level of forty-five, and suddenly Wednesday's jump means something. A category guide is a vertical line on a date, such as the day the storm made landfall. A range guide shades a band, such as the target zone for response times. Always give each guide a short label, so viewers don't have to guess what the line stands for.
Worked Example: Weekly Breaks. Let's build the director's chart. Add a serial chart and choose the water main breaks layer. Set the category to grouped values, using the reported date field, and bin by week, because a winter holds about thirteen weeks. Keep the statistic as count. Next, turn on a linear trend line for the value series. Finally, add a value guide at last winter's weekly average, say twelve breaks, and label it last winter average. Now the chart shows three things at once: each week's count, the overall direction, and how this winter compares with a normal one.
Read It Out Loud. A chart is finished when you can say its message in one sentence. Look at where the weekly counts sit against the guide. Weeks above it were worse than last winter. Then check the trend line's slope. Finally, look for spikes, and if two of them follow freezing nights, add category guides on those dates. So what would you tell the director? Something like this: breaks have run above last winter's average for five of the last six weeks, and the spikes followed the two cold snaps. That's an answer she can take straight to the council.
Common Mistake: The Partial Last Bin. Here's the trap that catches almost everyone. It's the fourth of the month, and the chart is binned by month. The current month holds only four days of requests, so its bar looks like a dramatic improvement. Worse, the trend line includes that tiny bar and tilts downward. People then celebrate a drop that doesn't exist. There are two fixes. You can filter the chart to end at the last complete period. Or you can keep the bin and label the current period as partial with a note or a guide. Either way, check the last bar before you share the dashboard.
Recap. Let's recap. First, a serial chart with a date category sorts every feature into one time bin, so choose a bin size that gives roughly twelve to sixty bins, and watch out for time zones and empty periods. Second, a trend line is the best-fitting straight line through your values. It shows direction and rate, but it doesn't show causes, and it isn't a forecast. Third, guides turn numbers into meaning: targets, normal levels and event dates. Always check the last bin, because a partial period can tell a false story.
Your Exercise. Now it's your turn. Pick any layer you have with a date field. Service requests, traffic incidents or outage records all work well, and a public Living Atlas layer is fine if you don't have your own. Build a serial chart binned by week. Add a linear trend line and one labelled guide, such as a target or an event date. Then check whether the last bin is a partial week, and handle it. Finish by writing the one sentence you'd say to your manager. In the next lesson we'll look at pie charts, and when they help or mislead.
استكشف الرسوم المتحركة
الرسوم المتحركة نفسها التي في الفيديو، دقيقة وتفاعلية: شغّلها أو أوقفها، أو اسحب المؤشر، أو انتقل إلى أي خطوة بالسرعة التي تناسبك.
Loading the animation...
Loading the animation...
ملخص الدرس
- مشاهدة الفيديو
- Bin dates to match the question (12 to 60 bins)
- Trend lines show direction, not cause
- Guides and honest last bins give context