The present invention relates to a method and an apparatus for generating a filling pattern for filling a product in a container, comprising a measuring unit (11, 12) for measuring each composition (10, 20); a filling head (30) having an output nozzle (31) oriented towards the mouth of a container (2); a distribution conduit (21, 22) configured for distributing the flow rate from the measuring unit to the filling head; rotating means (40) configured for rotating the container (2) about a vertical axis (Z) thereof and vertical displacement means (50) configured for varying the relative vertical distance between the container (2) and the nozzle (31). It additionally comprises horizontal displacement means (60) configured for varying the relative horizontal distance between the container (2) and the output nozzle (31) in a horizontal plane (XY) perpendicular to the vertical axis (Z); and control means for controlling the filling of the container (2).