الدرس 1 · الوحدة 4: Advanced Formatting and Data Expressions
Conditional formatting: coloring indicators by thresholds
الفيديو قريبًا
Learn it with your tutor on the live board
أهم نقاط الفيديو
A storm night, a missed number
- Midnight, winter storm, outage dashboard on the wall
- Indicator reads 1,240 customers out, in plain white
- It looked the same as when it read 12
- Color turns a number into a signal
What you will learn
- Explain what conditional formatting and thresholds are
- Design clean green, amber and red bands
- Configure rules on an indicator, including reference values
Conditional formatting, in plain words
- A rule: if the value meets a condition, change its look
- Threshold: the cut-off number where the look changes
- Applies to text color, background color and icon
- Set on the indicator element in ArcGIS Dashboards
How a rule gets applied
- The layer or query returns one value
- The indicator checks it against each rule
- The matching rule sets the look
- Refresh: the check runs again
Worked example: water main breaks
- Fewer than 5 open breaks: green
- 5 or more, but fewer than 12: amber
- 12 or more: red
- Edge tests: 4 green, 5 amber, 11 amber, 12 red
Seeing thresholds across districts
- Same rule, applied to every district
- Two lines split the chart into three bands
- South crosses the red threshold
layout: side
kind: bar
title: Open main breaks by district
data: {North: 3, East: 7, South: 14, West: 9}
steps:
- at: "four districts this morning"
show: all
- at: "First, mark the amber line"
line: {y: 5, label: amber 5}
- at: "Then add the red line"
line: {y: 12, label: red 12}
- at: "South is over it"
highlight: South Comparing to a reference value
- Reference value: a second number to compare against
- Options: fixed target, a statistic, or the previous value
- Rules can test the difference, not just the value
- Example: restored percent versus a 90 percent target
More than color
- Add an icon: check, warning, alert
- Change the label text, such as "Call contractors"
- Don't rely on color alone
- Keep the same colors across every indicator
Setting it up in ArcGIS Dashboards
- Edit the indicator, open the Indicator tab
- Turn on conditional formatting for the value
- Add a rule per band: condition, number, colors, icon
- Test with a filter to force each band
Common mistake: gaps, overlaps and direction
- Gap: "under 5" and "over 5" leave 5 uncolored
- Overlap: 5 to 12 and 12 to 20 both claim 12
- Direction: higher restored percent is good, not bad
- Test the exact boundary values
Recap
- Conditional formatting changes the look when a value crosses a threshold
- Bands must cover every value once, with clear direction
- Pair color with icons and text, and compare to references
Your exercise
- Pick one indicator: breaks, requests, outages or incidents
- Write three bands with an operations lead
- Configure the rules, with an icon per band
- Test the two boundary values and screenshot each state
النص المكتوب
A storm night, a missed number. Picture a winter storm at midnight. Your utility's outage dashboard is on the big screen in the operations center. One indicator shows customers without power, and it reads twelve hundred and forty, in the same plain white text it used when the number was twelve. The duty manager glances at it between phone calls and moves on. An hour later, a field supervisor asks why no extra crews were called. The number was on screen the whole time. It just didn't look urgent. A dashboard that looks the same on a calm day and a crisis day is only doing half its job. In this lesson we fix that with conditional formatting, so the screen changes color the moment a number crosses a line you care about.
What you will learn. Here's the plan. First, you'll be able to explain what conditional formatting is and what a threshold means, in words your manager would understand. Second, you'll design threshold bands, the classic green, amber and red, so every possible value lands in exactly one band, with no gaps and no overlaps. Third, you'll configure these rules on an indicator element in ArcGIS Dashboards, including rules that compare today's number to a target or to yesterday. We'll use examples from water main breaks, service requests, traffic incidents and outage response, because those are the numbers people actually stare at under pressure.
Conditional formatting, in plain words. Conditional formatting is simply a rule attached to a number. If the value meets a condition, the element changes how it looks. A threshold is the cut-off number where that change happens. Think of the fuel gauge in your car. The needle is just a position, but once it drops into the red zone, a light comes on and you pay attention. The red zone starts at a threshold. In ArcGIS Dashboards, the indicator element is where you'll use this most. An indicator shows one big number, such as open service requests, and its rules can change the text color, the background color, and the icon shown next to the value.
How a rule gets applied. Let's slow down and follow one value through the system. The indicator runs a statistic on a layer, for example the sum of customers affected across all active outage features. That gives one number. The dashboard then checks that number against your rules, applies the look of the rule that matches, and draws it. Then, when the refresh interval comes around, say every two minutes, the statistic runs again, the new number is checked again, and the color can change on its own. Nobody has to edit anything during the storm. The rules you wrote on a quiet afternoon do the watching for you.
Worked example: water main breaks. Here's a worked example. A water department tracks open main breaks. The crew lead says fewer than five is normal, five to eleven means crews are stretched, and twelve or more means call in contractors. Written as rules, that becomes three bands. Below five is green. From five up to, but not including, twelve is amber. Twelve and above is red. Notice each band starts exactly where the previous one stops. Now test the tricky values right at the edges. Four is green. Five is amber. Eleven is still amber. Twelve is red. Every number lands in exactly one band, and the boundary values go where the crew lead said they should. These are the same rules you'll enter in the dashboard.
Seeing thresholds across districts. Now let's apply the same thresholds to four districts this morning. North has three open breaks, East has seven, South has fourteen and West has nine. First, mark the amber line at five, and North sits comfortably below it, so North is green. East and West are above five but below twelve, so they're amber. Then add the red line at twelve, and only one bar crosses it. South is over it with fourteen. Which district would you send the contractor to first? The chart answers before you finish reading the numbers. That's exactly what a colored indicator does on a dashboard, one district per indicator, or one for the whole city.
Comparing to a reference value. Sometimes a raw number isn't the right thing to judge. An indicator can also show a reference value, which is a second number to compare against, like a target on a fitness tracker. It can be a fixed number you type, a statistic from another query, or the previous value. Your formatting rules can then test the difference instead of the value itself. For storm response, show the percent of customers restored, with a fixed target of ninety percent. Set the bands on the gap: less than five points short is green, five to fourteen points short is amber, and fifteen or more short is red. At eighty-two percent, the gap is eight points, so it falls in the amber band. Using the previous value, you can even flag when open traffic incidents jumped since the last refresh, which catches a sudden spike early.
More than color. Color is fast, but it isn't enough on its own. Some people on your team are color blind, and the wall screen in a bright room washes out amber and green. So pair each color with a second cue. Add an icon: a check mark for green, a warning triangle for amber, an alert circle for red. You can also change the text under the number to an action, such as "Call contractors" when the value turns red. Keep the meaning of each color the same across the whole dashboard. If red means bad on one indicator and red means high on another where high is good, people will misread it in a hurry.
Setting it up in ArcGIS Dashboards. Here's the setup in the app. Open your dashboard in edit mode, and configure the indicator for open service requests. On the Indicator tab, find the conditional formatting option and switch it on. Then add one rule for each band. Each rule has a condition, such as greater than or equal to, a threshold number, and the look it applies: text color, background color and icon. Keep the default look for your normal state. Finally, test it. Temporarily add a filter or change a threshold so the value falls into each band in turn, and watch the color change. It takes two minutes and saves you from discovering a broken rule during a real storm.
Common mistake: gaps, overlaps and direction. The most common mistake is sloppy boundaries. If one rule says less than five and the next says greater than five, a value of exactly five matches neither, and the indicator falls back to plain white on the one day it matters. The opposite problem is overlap: five to twelve and twelve to twenty both include twelve, so what happens depends on rule order. Start each band with greater than or equal to its lower threshold, so every boundary value belongs to the band above it. The lowest band simply covers everything below the first threshold. The second trap is direction. For open breaks, higher is worse. For percent of customers restored, higher is better, so red belongs at the bottom. Always test the exact boundary values before you publish.
Recap. Let's recap. Conditional formatting is a rule that changes how an indicator looks when its value crosses a threshold, so a number becomes a signal without anyone having to read it closely. Good bands cover every possible value exactly once, use greater than or equal to at each boundary, and match the direction of the metric, whether higher is worse or better. And strong indicators pair color with an icon or action text, keep color meanings consistent, and can compare against a reference value such as a target or the previous refresh. With those three habits, your storm night dashboard would have turned red long before anyone asked about crews.
Your exercise. Before the next lesson, pick one indicator from a dashboard you work with. Or build one from a layer in ArcGIS Living Atlas, Esri's free library of ready-made map layers, such as traffic incidents or service requests. Sit with whoever owns that number, an operations lead or a crew supervisor, and agree on three bands in plain words: what's normal, what's stretched, what needs action. Write them as thresholds with greater than or equal to at each boundary. Configure the rules on the indicator, with a color and an icon for each band. Then test the two exact boundary values and take a screenshot of each state. Next lesson, we'll push further with Arcade to format indicators, lists and tables.
استكشف الرسم المتحرك
الرسوم المتحركة نفسها التي في الفيديو، دقيقة وتفاعلية: شغّلها أو أوقفها، أو اسحب المؤشر، أو انتقل إلى أي خطوة بالسرعة التي تناسبك.
Loading the animation...
ملخص الدرس
- مشاهدة الفيديو
- Conditional formatting changes the look when a value crosses a threshold
- Bands must cover every value once, with clear direction
- Pair color with icons and text, and compare to references