Added exceptions to stock example for use of clientHeight in legend

Revert this commit if we can stop using clientHeight in legend