3

My map is crowded with pie chart symbols that overlap and obscure each other. Is there a way to draw these symbols so they don't overlap, perhaps drawing them not in their actual location but in a nearby empty space, with a line linking them to their actual location on the map? I need to print this map, so solutions that rely on a varying zoom level won't work. I'm using QGIS 2.18.16.enter image description here

  • 1
    You could use scale dependency (Layer Properties > Diagrams > Appearance > Scale dependent visibility). Which means you would have to zoom in close to see the pie charts which could avoid the overlap issue. – Joseph Mar 20 '18 at 11:08
  • 1
    That does work (technically) but the caveat is that I'm to be printing the map, so there won't be the option to zoom in. – McGraw Mar 20 '18 at 11:53
6

Custom placement of charts using data-defined position

Step 1: Add 2 columns to the attribute table, chart_x and chart_y

For a starting value, use the coordinates of each point. enter image description here

Step 2: Use the new fields to control diagram position

enter image description here

Step 3: Use the Move Label and Diagram tool to move each chart

Find the Move Label and Diagram tool in the Label Toolbar enter image description here

Editing must be enabled to use this tool. The attribute chart_x and chart_y values in the attribute table will be changed automatically when you move a diagram.

Alternative methods for step 3:

Use the coordinate capture tool to quickly find coordinates. Copy and paste the x and y values into the attribute table.

enter image description here

If you have several charts that you want to move by the same amount, select all the points for those charts, and batch edit them using the "updated selected" tool in the attribute table. enter image description here

Step 4: Add a line to connect each diagram to its point

Under layer style, add a symbol layer and select geometry generator for the symbol layer type. Use this expression to draw a line between the original point and the diagram location.

make_line( make_point( $x, $y), make_point( "chart_x" , "chart_y" ))

enter image description here

enter image description here

  • Excellent answer, very descriptive and thorough! – RyanKDalton Mar 21 '18 at 20:46

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.