Hello all
I am trying to set the size of the font in my feature class based on the value of the height field using arcgis pro labelling. I have set the expression to the following but it doesn't work. any ideas why??
"<FNT size = '10' * $feature.height>" + $feature.textstring + "</FNT>"
Regards
Andy
var size = $feature.OBJECTID
return `<FNT size='${size}'>Test</FNT>`
Johnnes
Thanks for the reply which works fine when i type the text in for display but i am obviously missing something when i want to display the text automatically from the field textstring.
var size = $feature.height * 6.66
return `<FNT size='${size}'>$feature.textstring</FNT>`
Please see the output on the image attached
Andy
var size = $feature.height * 6.66
return `<FNT size='${size}'>${$feature.textstring}</FNT>`
https://developers.arcgis.com/arcade/guide/template-literals/
Hi there,
This must be a syntax issue, try the following instead to skip size value between quotation marks (be careful not to forget single quotation mark at the end of the first part and in the beggining of the next one after $feature.height variable):
"<FNT size= '" + 10 * $feature.height + "'>" + $feature.textstring + "</FNT>"
Regards,
Kepa
Edit: @JohannesLindner was faster, and better arcade syntax. Great!