Auto-Hide Legend

Automatically hide a chart legend if it contains more than set number of entries.