Select to view content in your preferred language

Filter Action from Serial Chart from Calculated Category

159
0
03-09-2025 10:36 PM
Labels (1)
JohnKristian
Emerging Contributor

Is it possible for a serial chart based on a calculated category to have an action that filters a map or list drawn from the same feature layer?

I tried this. Categories for the serial chart are calculated in a data expression based on a hosted feature layer. The chart is correct. But when I add filter actions to the serial chart, it shows the source field is the calculated category field. I don't see a way to choose a different source field. Of course, I can choose any target field in the feature layer, but none of those fields will match the calculated field correctly.

Here's the data expression. The hazards field comes from a select_multiple field in Survey123 Connect.

var source = FeatureSetByPortalItem(Portal('redacted'), 'redacted', 0, ['objectid', 'hazards'], false);
var features = [];
for (var f in source) {
if (f.hazards != null) {
var parts = Split(f.hazards, ',');
if (Includes(parts, 'Fire_Burning')) {
Push(features, {attributes: {objectid: f.objectid, hazards: f.hazards, status: 'Burning'}});
} else if (Includes(parts, 'Smoke')) {
Push(features, {attributes: {objectid: f.objectid, hazards: f.hazards, status: 'Smoke'}});
} else if (Includes(parts, 'Fire_Extinguished')) {
Push(features, {attributes: {objectid: f.objectid, hazards: f.hazards, status: 'Out'}});
}
}
}
var result = {
geometryType: '',
fields: [
{name: 'objectid', 'type': 'esriFieldTypeInteger'},
{name: 'hazards', 'type': 'esriFieldTypeString'},
{name: 'status', 'type': 'esriFieldTypeString'},
],
features: features,
};
return FeatureSet(Text(result));

 

0 Kudos
0 Replies