I would like to use Arcade to show z-min and z_max (both are attributes of the features) in a fraction.
To get both values as a multi-line label is easy, but then I am basically missing two things.
Is that possible with Arcade, and/or is there any other way to achieve that with ArcGIS Pro?
Solved! Go to Solution.
I was able to get a horizontal line between the two that is the length of the longer value, but I couldn't get them aligned with the decimal point.
When using this script, you have to unselect the "Remove extra spaces" option.
var numerator = $feature.MIN;
var denominator = $feature.MAX;
var numLength = Count(Text(numerator));
var denLength = Count(Text(denominator));
if (numLength < denLength) {
var diff = Ceil((denLength - numLength)/2);
for (var j=0; j <= diff; j++) {
numerator = ` ${numerator} `
}
}
return `<align horizontal ='center'><UND>${numerator}</UND>${TextFormatting.NewLine}${denominator}</align>`
I was able to get a horizontal line between the two that is the length of the longer value, but I couldn't get them aligned with the decimal point.
When using this script, you have to unselect the "Remove extra spaces" option.
var numerator = $feature.MIN;
var denominator = $feature.MAX;
var numLength = Count(Text(numerator));
var denLength = Count(Text(denominator));
if (numLength < denLength) {
var diff = Ceil((denLength - numLength)/2);
for (var j=0; j <= diff; j++) {
numerator = ` ${numerator} `
}
}
return `<align horizontal ='center'><UND>${numerator}</UND>${TextFormatting.NewLine}${denominator}</align>`
Thank you so much! I can see the issue with the alignment to the decimal point... Lucky enough it's not a strict requirement, but in terms of typography and cartography it would be nice if Arcade could support that.