I used the following link to create labels with leaders, but since I have a polyline layer I used a different expression for the Geometry Generator:
make_line(
centroid($geometry),
make_point("auxiliary_storage_labeling_positionx", "auxiliary_storage_labeling_positiony")
)
It appears to work, but looks quite ugly, where some of the leaders go past the geometry centroid as follows:
And others fail to reach it:
Why does this occur and how can I fix it?


$length/2. – Taras Feb 18 '19 at 10:15make_line( line_interpolate_point($geometry, $length/2), make_point( "auxiliary_storage_labeling_positionx" , "auxiliary_storage_labeling_positiony" ) )– user32882 Feb 18 '19 at 10:18