Escolar Documentos
Profissional Documentos
Cultura Documentos
English
The Label item is a tool that helps decorate your map with texts that would help to
understand it; it can be the title, author, data sources or any other information… You can
add a label with the (../../../../_images/mActionLabel.png) Add Label tool following
items creation instructions (composer_items_options.html#create-layout-item) and
manipulate it the same way as exposed in Interacting with layout items
(composer_items_options.html#interact-layout-item).
By default, the label item provides a default text that you can customize using its Item
Properties panel. Other than the items common properties
(composer_items_options.html#item-common-properties), this feature has the
following functionalities (see figure_layout_label):
Label Item Properties Panel
Main properties
The Main properties group is the place to provide the text (it can be in HTML) or the
expression to build the label. Expressions need to be surrounded by [% and %] in
order to be interpreted as such.
Note
Clicking the Insert an Expression button when no selection is made in the textbox
will append the new expression to the existing text. If you want to update an existing
text, you need to select it the part of interest beforehand.
You can combine HTML rendering and expressions, leading to e.g. a text like:
which will render: Check out the new logo for QGIS 3.0 (https://www.qgis.org) :
(../../../../_images/logo.png)
Appearance
Define Font by clicking on the Font… button or a Font color by pushing the color
widget (../../introduction/general_tools.html#color-selector).
You can specify different horizontal and vertical margins in mm . This is the margin
from the edge of the layout item. The label can be positioned outside the bounds of
the label e.g. to align label items with other items. In this case you have to use
negative values for the margin.
Using the text alignment is another way to position your label. It can be:
Left , Center , Right or Justify for Horizontal alignment
and Top , Middle , Bottom for Vertical alignment .
Retrieve the name of the layers in the current layout ‘Map 1’ item, and formats in one
name by line:
array_to_string(
array_foreach(
map_get( item_variables( 'Map 1' ), 'map_layers' ), -- retriev
e the layers list
layer_property( @@eelleemmeenntt, 'name' ) -- retrieve each layer name
),
'\\nn' -- converts the list to string separated by breaklines
)
(http://twitter.com/qgis)
(https://www.facebook.com/pages/QGIS-Quantum-GIS-/298112000235096)
(http://plus.google.com/communities/114776597176808981624)
(http://github.com/qgis/) (http://www.qgis.org/en/site/getinvolved/index.html)
If not stated otherwise, all content is licensed under Creative Commons Attribution-ShareAlike 3.0 licence (CC BY-
SA) (http://creativecommons.org/licenses/by-sa/3.0/)
/source/docs/user_manual/print_composer/composer_items/composer_label.rst)