Fix legend when svg is hidden - #468