You have posted this in a Qliksense forum, but you seem to be asking for a Qlikview solution.
It is possible in Qlikview. Create a chart (bar, line, pie or combo) with the correct dimension for the legend and a dummy expression (eg =1). Then click the chart and/or legend and hold down Shift and Control together. Play around with resizing the chart by dragging the red bounding box borders so it is small and outside the chart object and getting the legend to fill the chart object.
Tip: size the object to the desired final size, as resizing it will change the layout.
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein