Open this page in the API Guide

Legend.invalidateSize Method

Notifies the control that its container element size may have changed.