1

Is there a way to use label expressions in ArcGIS 10.x to specify the font size for a label from the values in a field?

So as an example, I have a point dataset which I wish to label, and within the attribute table there is a numeric field called "size" which holds the size I want the label for that feature to be.

I've managed to use an expression to specify a font and a single size for the whole dataset

"<FNT name = 'Arial' size = '12' >" & [gml_id] & "</FNT>"

But if I try to replace the number 12 with the name of the field which holds the font sizes, the code doesn't work i.e.

"<FNT name = 'Arial' size = [size] >" & [gml_id] & "</FNT>"

The above expression prints the expression as the label, rather than the values from the "gml_id" field. So this made me think that it was interpreting the whole thing as a string because it's all in double quotes, however removing the quotes gives me a syntax error.

"<FNT name = 'Arial' size = '[size]' >" & [gml_id] & "</FNT>"

The above expression gives me no label.

"<FNT name = 'Arial' size = "[size]" >" & [gml_id] & "</FNT>"

The above expression gives me a syntax error.

Anybody know where I am going wrong or even if this is possible?

asked Oct 21, 2013 at 10:14

1 Answer 1

2

You almost nailed it down.

"<FNT name = 'Arial' size = '" & [sizefield] & "' > " & [gml_id] & " </FNT>"
answered Oct 21, 2013 at 10:39

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.