Does anyone know to set up a value conversion in a pie chart? I know we can do this easily for indicators and gauges, but that I might need to use a data expression for the pie chart. I have no idea how to set that up.
I have a field called Calc_Length and it is in feet, but I need to convert it to miles for my pie chart.
I know that I need to multiple my Calc_Length by 0.00018939 to get it in miles.
You'd need to use a data expression for this, which is frankly a bit of overkill just to show the values multiplied by that decimal. But I don't see another way of doing it, so here's what it'd look like:
// get your layer
var fs = FeatureSetByPortalItem(
Portal('https://arcgis.com'), //or your portal URL if you're not using AGOL
'itemid of the feature service',
0, // the layer index
['Calc_Length', 'objectid'],
false
)
return Distinct(
fs,
[
{name: 'objectid', expression: 'objectid'},
{name: 'miles', expression: 'Calc_Length * 0.00018939'}
]
)