Select to view content in your preferred language

How to format the No Value/No Data text on an indicator with responsive text as if it had a value

905
1
05-17-2022 09:05 AM
NickN
by
Frequent Contributor

The title probably isn't a great description of what I'm trying to do.

I have 3 indicators, they each display the attribute of polygon that intersects a specific point. Sometimes there are no polygons that intersect. When this happens the widget uses the "No data" configuration under General in the widget configuration.  This is as expected. HOWEVER! I cannot figure out how to get the text I decide to display in the same manner as if there was data.

Annotation 2022-05-17 110100.png

 

The first two indicators pull the attribute as there is an intersecting polygon so they work as expected. The last indicator has no intersecting polygon so it uses the No data display. I cannot figure out how to get the "NONE" to format and be responsive as the "TSTM" in the other indicators are. It's visually jarring that the text is not vertically aligned the same.

Maybe I've overlooked something. Ideas are appreciated, thanks!

Tags (2)
0 Kudos
1 Reply
NickN
by
Frequent Contributor

I've come up with a workaround for my situation. I created another layer that has the same field structure as the polygon layer I'm using for the intersection and I created a single feature and populated the corresponding field with "NONE" Then in the Arcade for the widget if there is no polygon returned from the original service (checking with Count) then it runs the intersect on the new layer thereby returning a featureset with one polygon containing the attribute "NONE".

Basically I added a layer called empty to return the NONE if there aren't intersecting polygons in the original service and checked like this:

var $risk_polys = Intersects($original_service, $point);
if (Count($risk_polys) > 0) {
    return $risk_polys;
}
else {
    return Intersects($empty, $point);
}

 

 Now it lines up properly

Annotation 2022-05-17 122702.png

 

Hope that makes sense, and I'd still be interested to hear if there's a "proper" way to do this built into the dashboard.

0 Kudos