Hi,
I am trying to add charts to my popups and was able to get the result from the image below:
but in my popup the chart just kept loading and refused to show up at all:
I'd appreciate it if anyone could shed some light on what I did wrong. Thanks.
Here is my Arcade expression:
var a = FeatureSetByName($datastore, 'Data', ['Bldg_Num', 'Room_Type_Description', 'ASF'])
var bn = $feature.BuildingNumber
var v = Filter(a, 'Bldg_Num=@bn')
var stats = GroupBy(v, 'Room_Type_Description', {name: 'Area', expression: 'ASF', statistic: 'SUM'})
var allSpcTP = OrderBy(stats, 'Area')
var Values = {}
var pieNames = []
for (var i in allSpcTP){
Values[i.Room_Type_Description]= Number(i.Area);
Push(pieNames, i.Room_Type_Description)
}
return {
type: "media",
attributes:Values,
mediaInfos:{
type: "barchart",
title: 'Room type sqare footage',
value: {
fields: pieNames
}
}
}