Feature request #5048

Labeling's "Data defined settings" are literally used for size, etc.

Added by Aren Cambre about 5 years ago. Updated about 3 years ago.

Status:Closed Start Date:02/18/2012
Priority:Normal Due date:
Assigned to:- % Done:


Target version:Future Release - Nice to have
Platform: Resolution:
Platform version: Pull Request or Patch supplied:No
Status info: Tag:


If I specify a data-defined setting for Size for the labeling feature, it appears that the selected field is used to literally affect that property.

For example, I have a SHP that has all city limits in Texas. One field is the city's population. The field varies from very few (probably around 10) to well over a million. I cannot imagine a useful diagram that has font sizes varying from 10 points to over a million points.

Please instead allow the value to vary within a predefined scale. E.g., on the example of the city population, I'd rather the value vary between, say, 10pt and 50pt font, so that the smallest city has a 10pt font and the largest city has a 50pt font. I'm OK if QGIS has an automatic way of providing a meaningful, initial value for the bounds on size, but I'd like to be able to override these, too.

You might counterargue that I should create a separate field in my dataset to handle this value. That has two problems:
  1. I'd have to edit the SHP, which is cumbersome.
  2. Even if this was easier to edit, such as a PostGIS dataset, I'm still having to guess how everything should look before I can even see it.

I've attached images to show how things look before and after using the city population for the size field.

labeling_settings.png (39.1 kB) Aren Cambre, 02/18/2012 02:09 pm

normal_labeling.png (356.7 kB) Aren Cambre, 02/18/2012 02:09 pm

labeling_with_data_defined_settings.png (128 kB) Aren Cambre, 02/18/2012 02:09 pm

Related issues

related to QGIS Application - Bug report #5049: Data-defined labeling takes 1560% longer to render Closed 02/18/2012


Updated by Aren Cambre about 5 years ago

I should have named this ticket better since it's a feature request, not a bug.

If someone has authority to rename, new title should be Labeling's "Data defined settings" should vary within reasonable boundaries.

Updated by Aren Cambre about 5 years ago

Related: #5049

Updated by Giovanni Manghi about 5 years ago

  • Target version set to Version 2.0.0

Updated by Pirmin Kalberer over 4 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

Updated by Nyall Dawson almost 4 years ago

  • Status changed from Open to Feedback

This might be closable now -- this can be achieved by using an expression for the definition and using the new "scale_linear" function.

Updated by Larry Shaffer almost 4 years ago

The branch I'm working on to provide the expression-based data defined values should be ready in the next day or so. Support for this particular feature request (label font size calculated via an expression) is already done.

Updated by Larry Shaffer almost 4 years ago

  • Status changed from Feedback to Resolved

Should be fixed with commit 45f374f4

Expressions can be used to provide solution to issue.

Reopen if necessary

Updated by J├╝rgen Fischer about 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom