QGIS Pie Chart – Moving Pie Chart in QGIS and Creating Leader Line

chart;leader-lineqgis

I'm using QGIS 2.18.3 (Las Palmas).
I have created pie charts for a layer in QGIS and in order to be able to move the pie charts around i processed the centroids of my polygons. By moving the (Centroid) points I am now able to move the pie charts around.

I still have some overlapping in my charts, so i'm looking into creating leading lines, so I can allocate the pie chart to its polygon. I have looked into previous questions here (for example How to create dynamic leader lines? or Creating leader lines for moved labels) but I dont seem to be able to use it for the charts.

How can I create a leading line for a pie chart?

Best Answer

Creating centroids was an unneccessary step. The placement properties of the diagrams offer "Data defined positions". First you create the "x_coor" and "y_coor" columns. I don't know what coordinate system you are using. Length 15 Precision 3 is enough for almost everything. Leave the two columns empty.

enter image description here

Within the properties of the diagrams, activate the "Data defined position" in "Placement". Use the "x_coor" and "y_coor" column. enter image description here

Start the Editing Mode and use the label toolbar to move your diagrams where you want them. enter image description here

Save the Edits and close the editing mode. Now open your attribute table, "x_coor" and "y_coor" are filled up with coordinates.enter image description here

In the next step, open the properties of the layer and change the style options. Within the style options, we want to change the symbol. Default ist the "Simple Fill", change that to "Geometry Generator". You have to change the "Geometry Type" to "LineString / MultilineString". enter image description here

I've loaded my polygon-layer twice. Once I use them for the normal polygons and once for the geometry-generator to create the leader lines. I have created the diagrams only for the layer with the geometry generator.

enter image description here

Related Question