Friday, November 4, 2016

Label Expression - Advance (VBScript)

Ví dụ - dòng code  trong Label expression (Advanced VBScript): 
Function FindLabel ( [loaiDatHT], [loaiDatQH] )
  FindLabel = "<UND>" &  [loaiDatHT] & "</UND>" & vbnewline & "<CLR red='255' green='0' blue='0'>" & [loaiDatQH] & "</CLR>"
End Function
=> Kết quả:


Link tham khảo: http://webhelp.esri.com/arcgisdesktop/9.1/index.cfm?TopicName=About%20building%20label%20expressions
Trích link:
ArcGIS text formatting tags
Labels will be drawn using the symbol specified in the Label Manager or on the Labels tab of the Layer Properties dialog box. You can modify or override the appearance of this symbol for particular portions of the expression by inserting ArcGIS text formatting tags into the expression as text strings. This lets you create mixed-format labels where, for example, one field in a label is underlined.
The tags that you can use are listed in the table below. Acceptable values for Color (RGB) are red, green, blue = 0–255, and acceptable values for Color (CMYK) are cyan, magenta, yellow, black = 0–100; missing color attributes are assumed to be 0.
Font
"<FNT name='Arial' size='18'>" & [LABELFIELD] & "</FNT>"

"<FNT name='Arial' scale='200'>" & [LABELFIELD] & "</FNT>"
Color
"<CLR red='255' green='255' blue='255'>" & [LABELFIELD] & "</CLR>"

"<CLR cyan='100' magenta ='100' yellow='100' black='100'>" & [LABELFIELD] & "</CLR>"
Bold
"<BOL>" & [LABELFIELD] & "</BOL>"
Italic
"<ITA>" & [LABELFIELD] & "</ITA>"
Underline
"<UND>" & [LABELFIELD] & "</UND>"
All capitals
"<ACP>" & [LABELFIELD] & "</ACP>"
Small capitals
"<SCP>" & [LABELFIELD] & "</SCP>"
Superscript
"<SUP>" & [LABELFIELD] & "</SUP>"
Subscript
"<SUB>" & [LABELFIELD] & "</SUB>"
Character spacing (0%=regular)
"<CHR spacing='25'>" & [LABELFIELD] & "</CHR>"
Character width (100%=regular)
"<CHR width='150'>" & [LABELFIELD] & "</CHR>"
Word spacing (100%=regular)
"<WRD spacing='150'>" & [LABELFIELD] & "</WRD>"
Line leading (pts)
"<LIN leading='12'>" & [LABELFIELD] & "</LIN>"
Un-Bold
"<_BOL>" & [LABELFIELD] & "</_BOL>"
Un-Italic
"<_ITA>" & [LABELFIELD] & "</_ITA>"
Un-Underline
"<_UND>" & [LABELFIELD] & "</_UND>"
Un-Superscript
"<_SUP>" & [LABELFIELD] & "</_SUP>"
Un-Subscript
"<_SUB>" & [LABELFIELD] & "</_SUB>"