Fixed bug where legend wasn't rendered correctly in mobile mode.