3

I have shapefile that has data about each country like population size, smoking rate and more. Is there any simple way to display this data as circles on top of each country? something simmilar to the quantity in arcmap, like we see these days with the corona maps: enter image description here

I have tried from the diagrams but seems like it's from there. also Thought to create centroid and then display by size but was wondering if there is easier way.

My end goal : to be able to display quantity data with circles.

| improve this question | | | | |
3

Here's another method, using Graduated symbology. The results are similar to the size assistant method explained by Vincent Bre, with a few differences:

  • With the graduated symbology method, you can toggle on and off each size category.
  • With the graduated symbology method, you can see the different sizes in the legend.
  • With the size assistant method, you could also apply a categorized or graduated style using different colors. For example, you could have point size represent population size, and point color represent proportion of smokers.

How to use Graduated Symbology to control point symbol size

  1. Open the Layer Styling Panel or Layer Style tab in the Properties window.
  2. Apply a Graduated style to your point layer.
  3. Choose the Column (eg, population size) to control the symbol size.

    • Note: the column must have a numerical data type. If your column doesn't show up as an option, its datatype is probably set as text. That's common with CSV formatted data. See here or here for a solution.
  4. Change the Method from "color" to "size."
  5. Click "Classify" to apply a size range based on your chosen column.

enter image description here

enter image description here


The above method requires points. To apply it to a polygon layer, you'll need to convert the geometry to points. Here are a few different methods.

  • Use the Centroids algorithm, found in the Processing Toolbox. This method actually creates a separate source data file (IE another shapefile, geopackage, or w/e format your data is in).
  • Use the Point on Surface algorithm. Like the Centroids algorithm, this creates a separate layer. Use this method if you have irregularly shaped polygons whose centroids fall outside the polygon.
  • Create a Virtual Layer. This method creates a separate layer in the layer panel, but it doesn't create a new source data file. I can't provide a tutorial for this method, but it is explained in the QGIS User Manual. People who know SQL seem to like virtual layers, but as an SQL-illiterate person I find them very confusing. Thanks to snaileater for the suggestion.
  • Use a Geometry Generator style. In the Layer Styling panel, where it says "Symbol" click the "change" button. Change the symbol layer type to "geometry generator", use the formula centroid($geometry) and change the geometry type to point. Or, if the centroids are not all inside their respective polygon, use point_on_surface( $geometry).

    image

| improve this answer | | | | |
  • i'm tryinf to do that but I have polygons layer and not dot layer, is there anyway to do the same thing without creating points from my polygons? – Reut Mar 24 at 17:15
  • You can add a new layer (using a virtual layer) extracting the centroid of your polygon layer ... – snaileater Mar 24 at 17:46
  • @Reut I added a few methods for converting to points at the end of my answer. I would probably go with the geometry generator method. – csk Mar 24 at 19:48
5

For the example, I created a point layer with 5 points and a field "population".

enter image description here

  1. Properties of your layer > Symbology > Simple marker > Assistant

enter image description here

The assistant allows you to vary the size of your symbology according to a rule, for example the numerical value of a field.

  1. In the assistant window, choose the field in which you want to vary the size and then refresh. Then, you can vary the parameters, I let you explore.

enter image description here

  1. You can Apply. The result is the following :

enter image description here

| improve this answer | | | | |
  • You can also do this directly to a polygon layer, using the "centroid fill" option and the calculation assistant to controll the size. It won't show up in the legend though. – Borgh Mar 25 at 9:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.