I realize this is an old post, and hope this reply is allowed. I am seriously stuck on configuring a pop-up with similar AADT data, Teresa, and if you can provide any guidance, any and all will be appreciated! I followed your code to almost a T, but am getting a blank graph as a result.
var Road = $feature.ROADNAME
var Table = FeatureSetByName($map, "ADT_Data_Merge", ['Mean_ADT','Year','Road_Name'])
var AADT = OrderBy(Filter(Table, 'Road_Name = @Road'), 'Year ASC')
var chartValues = {}
var chartNames = []
for (var f in AADT) {
chartValues[Text(f.Year,'0000')] = Text(f.Mean_ADT,'###,###')
Push(chartNames, f.Year)
}
return {
type: 'media',
title : 'AADT by Year',
description : 'Annual average daily traffic by year for this road',
attributes : chartValues, // replace this dictionary with your own key-value pairs,
mediaInfos: [{
type : 'linechart', //linechart | barchart | piechart | columnchart
//title : '',
//caption : '',
altText : 'line chart showing traffic counts by year', //altText will be read by screen readers
value : {
fields: chartNames, // choose what attributes to use in the chart
//normalizeField : '', // the name of the attribute to normalize by or value
}
}]
}