I would calculate offset distance (
dx) for each feature, so that I can position them by
(x, y) = ($x+dx, $y).
An example of expression to calculate
with_variable('my_array', array_agg("symbols", group_by:="geom_to_wkt($geometry)"),
5 *(array_find(@my_array, "symbols") - floor(array_length(@my_array)/2)))
- You will need to modify
"symbols" according to your attribute field which defines your categorized symbols.
- The second line has a factor
5, but it is arbitrary. Please adjust this number by visually checking your output.
To modify x-location of symbols according to the
dx calculated above, there would be some options:
(Option 1) Geometry generator
This is dynamic way, and probably a preferred option. In the
Layer Properties window, click on Change button next to
Symbol. Then select Geometry generator as the
Symbol layer type and Point/Multipoint as the
Geometry type. The actual expression would be
(Option 2) Create points layer from table
This tool is found under
Processing Toolbox | Vector creation. It is more static way and requires
new_x field (by
new_y field (
$y, so it is not new). One merit of this approach is that you can later modify
new_y field manually, so that you can place them in two or three rows if you like.