Turns out the problem was with the definition of the layout in landscape mode. Elements from the main layout were showing up on top of the graph's legend.